Closed belm0 closed 6 years ago
I couldn't find this info anywhere within the WebSocketConnection internals, including _wsproto
(host
and resource
are both None) and _socket
.
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.
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.
WebSocketConnection doesn't appear to expose information from the HTTP handshake, such as path.
This is a show stopper for my use case.