Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interceptor Proxy Support for Websockets #654

Open
Tracked by #911
axisofentropy opened this issue Apr 5, 2023 · 5 comments
Open
Tracked by #911

Interceptor Proxy Support for Websockets #654

axisofentropy opened this issue Apr 5, 2023 · 5 comments
Labels
help wanted Extra attention is needed stale-bot-ignore All issues that should not be automatically closed by our stale bot

Comments

@axisofentropy
Copy link

axisofentropy commented Apr 5, 2023

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: #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?

@axisofentropy
Copy link
Author

If this is not crazy, I may have time to work on it later this year.

@fbalicchia
Copy link

@axisofentropy did you try to enable http2 on the interceptor?
https://github.com/kedacore/charts/blob/main/http-add-on/values.yaml#L105

@stale
Copy link

stale bot commented Jul 9, 2023

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.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Jul 9, 2023
@JorTurFer JorTurFer added the stale-bot-ignore All issues that should not be automatically closed by our stale bot label Jul 12, 2023
@stale stale bot removed the stale All issues that are marked as stale due to inactivity label Jul 12, 2023
@davidmnilsson
Copy link

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.

@guilhem
Copy link

guilhem commented Nov 8, 2023

#835 should fix the issue.

At least work for me with openvscode-server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed stale-bot-ignore All issues that should not be automatically closed by our stale bot
Projects
Status: To Triage
Development

No branches or pull requests

5 participants