Skip to content

WebSocketConnection does not expose handshake path, etc. #17

Closed

Description

@belm0

WebSocketConnection doesn't appear to expose information from the HTTP handshake, such as path.

This is a show stopper for my use case.

Activity

  1. belm0 commented on Sep 8, 2018

    @belm0
    MemberAuthor

    I couldn't find this info anywhere within the WebSocketConnection internals, including _wsproto (host and resource are both None) and _socket.

  2. belm0 commented on Sep 9, 2018

    @belm0
    MemberAuthor

    I believe this requires inspecting the event h11request when the wsproto ConnectionRequested event is received.

    It seems that trio-websocket takes the approach of encapsulating wsproto as an implementation detail. So to follow this we would have to wrap all the details of the request...

    For now I'll make a PR to expose path as a property on WebSocketConnection, and we can consider from there.

  3. belm0 commented on Sep 9, 2018

    @belm0
    MemberAuthor

    A complication: the user handler is called prior to receiving ConnectionRequested. So with the current API, the user cannot know when the new path property will be valid.

    For a simplistic API like this I suggest that the user handler only be called in the case of successful handshake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions