http-add-on
http-add-on copied to clipboard
Interceptor Proxy Support for Websockets
I'd like this http-add-on Interceptor Proxy to also support WebSocket connections.
Use-Case
Currently WebSocket connections are not supported through the Interceptor proxy. Per this discussion, HTTP requests with upgrade headers receive HTTP 403 responses: https://github.com/kedacore/http-add-on/discussions/618
I hope we can add logic to the Interceptor proxy to identify HTTP requests with these WebSocket headers and hand them off to a different HTTP handler.
Specification
I found an MIT-licensed library that produces an http.Handler object capable of proxying WebSocket connections. https://github.com/koding/websocketproxy/blob/master/websocketproxy.go
I imagine that when an incoming HTTP request tries to upgrade to a WebSocket connection, the Interceptor's existing Handler can hand it off to another Handler created using this library, which can support a proxied WebSocket connection.
While I'm familiar with the relevant networking protocols, I'm not very familiar with golang and its net.http library. Could this work? Can Handler objects be "chained"? Is this the right integration point?
Alternatively, could we add some pieces of that library to the existing proxy handler to support WebSockets?
If this is not crazy, I may have time to work on it later this year.
@axisofentropy did you try to enable http2 on the interceptor? https://github.com/kedacore/charts/blob/main/http-add-on/values.yaml#L105
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
I have the same issue when trying to run Jupyter Notebooks using Voila. All the ipywidgets use wss. Since I can't change the auto transformation in Voila I can't use the http-add-on/interceptor. I also get a 403. WebSocket support would allow me to use the http-add-on, right now it's a blocker.
#835 should fix the issue.
At least work for me with openvscode-server.