Repository navigation
Uses HTTP/1.1 and HOST header for CONNECT method - #677
Conversation
Codecov Report
@@ Coverage Diff @@
## master #677 +/- ##
==========================================
+ Coverage 71.31% 71.64% +0.32%
==========================================
Files 13 13
Lines 1304 1305 +1
Branches 259 259
==========================================
+ Hits 930 935 +5
+ Misses 249 246 -3
+ Partials 125 124 -1
Continue to review full report at Codecov.
|
|
Thank you for the detailed PR 👍 If you are using a public or open source proxy, could you share which proxy you are using? I am not sure if any edge case issues may be encountered by adding this specific Host header value in certain proxies, so I would like to document this for future knowledge. As for using HTTP/1.1, websocket-client already uses HTTP/1.1 for non-proxy connections, so I don't see a problem doing the same for proxy connections. |
|
Thank you for merging it! I'm sorry that I don't know well which proxy is used since our company manages it. |
1. What is the problem with the current code
I'm behind a proxy and I have a problem that the proxy server blocks websocket-client's connections.
The proxy server reads HOST header in order to filter connections, but I found that websocket-client does not add HOST header to CONNECT method.
cpython's library also has the same problem that websocket-client has. python/cpython#8305 will solve it.
2. How your changes make it better
This adds HOST header to CONNECT method and uses HTTP/1.1.
3. Provide some example code that can allow someone else to recreate the problem with the current code and test your solution (if possible to recreate).
https://github.com/websocket-client/websocket-client/blob/master/examples/echo_client.py can be used to recreate.
Without this PR
With this PR