valohai / asgiproxy

Tools for building HTTP and Websocket proxies for the asynchronous ASGI protocol
MIT License
30 stars 1 forks source link

Forward subprotocol correctly to and from upstream ws #11

Open aksh-at opened 9 months ago

aksh-at commented 9 months ago

The proxy currently accepts the client websocket request without any subprotocols, even if they were sent by the client.

This PR forwards the protocols to the upstream websocket in the connection request, and then returns the protocol that was chosen back in accept.

ekzhang commented 6 months ago

@valohai — I just updated our fork to use get_upstream_url_with_query in the WebSocket proxy handler instead of parsing the query parameters into a multidict.

(Also we're not using asgiproxy anymore but really appreciate this library!)