-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support http proxies for websockets #16326
Conversation
CodSpeed Performance ReportMerging #16326 will not alter performanceComparing Summary
|
71cb046
to
b299653
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The integration test is awesome! I have a couple of comments, but overall this is looking great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Closes: #15474
This PR introduces a wrapper class
WebsocketProxyConnect
to support websocket connections through an http proxy. It does this by passing the proxy negotiation off topython-socks
, getting a fully connected socket and then passing that open socket back towebsockets
for the rest of the process.It supports the standard environment variables
HTTP_PROXY
andHTTPS_PROXY
, which is what we would expect a client to set currently for using a proxy with regular http requests.This PR also adds an integration test setup with a simple api and a squid proxy, to ensure it is working properly. I had difficultly getting this to work entirely in pytest, so it has it's own directory of config + a github action. Looking for feedback if this is a fine approach.