-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
Add support for HTTP(S) proxies to connect() #422
base: main
Are you sure you want to change the base?
Conversation
This is missing proper error handling, tests and support for WSS.
Codecov Report
@@ Coverage Diff @@
## master #422 +/- ##
==========================================
- Coverage 100% 98.64% -1.36%
==========================================
Files 29 29
Lines 3170 3252 +82
Branches 333 352 +19
==========================================
+ Hits 3170 3208 +38
- Misses 0 37 +37
- Partials 0 7 +7
Continue to review full report at Codecov.
|
Most likely this doesn't close one of the two transports when the connection terminates. |
So any updates? |
Nothing more than the public comments here. |
afc924a
to
8d51ce2
Compare
I'm really looking forward to this 👍 |
@aaugustin could you please update this, so that I can still use it with the latest version? |
Feel free to do the rebase yourself and post a link to it here, if you're really in a hurry that's probably the best course of action. Others may pitch in by testing said new branch and giving feedback on it as well. Cheers |
Well, going from this PoC to a properly tested implementation that supports all cases (HTTP/HTTPS => HTTP/HTTPS) is rather boring. I haven't been motivated to do it. Besides writing tests:
Proxies are most common in corporate networks. If you work at a company that relies on websockets and needs this feature, please consider paying for its development. Get in touch at aymeric.augustin at fractalideas.com if you're interested. Before downvotes pour in, I'd like to say that paying people is a time-proven way to get them to do things they wouldn't do by themselves otherwise ;-) |
So what should we do for this feature (not PR) to be merged? Shall we continue this PR (I'm sorry but I haven't tested this yet) or start from a scratch? I'm not really familiar so I'm not sure if I can help but at least I can try. Or buy enough ☕️ for you and wait? If it works, I think it's a fair request 👍 (but then how much? 😁) |
Python 3.7 added start_tls, which removes the need for the ugly hack. If we use it, proxying to a WSS endpoint will require Python ≥ 3.7. I think that's fine. |
Agree. Less code to maintain. 🙂 |
Hi guys... I had to make proxies work with websockets, where the proxy server required NTLM authentication (just to make things interesting)... My fork is here with explanatory notes added to README: https://github.com/mdymike/websockets Hopefully someone finds that useful. I don't feel it's polished enough yet to do a pull request so just putting it out there 'as-is' for now :) Best, Mike |
@aaugustin, hi, I don’t want to bug you with this too much, but now that Thanks in advance, and I hope you stay safe in this pandemic. |
I tested the fork by Mike and can confirm that it works behind a corporate proxy 😄 👍 It would be nice to see proxy support in the official websockets library. |
I have forward-ported this pull request to the current websockets code using |
1726dba
to
61e0e1c
Compare
dba135f
to
e10eeba
Compare
c760cdf
to
5eafbe4
Compare
Fix #364.