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

bug: HTTP 407 error when AtlasStream(Streaming API) x proxy authentication #65

Open
itaru2622 opened this issue Aug 25, 2023 · 0 comments · May be fixed by #66
Open

bug: HTTP 407 error when AtlasStream(Streaming API) x proxy authentication #65

itaru2622 opened this issue Aug 25, 2023 · 0 comments · May be fixed by #66

Comments

@itaru2622
Copy link

websocket-client document says:
it needs http_proxy_auth attribute when proxy requiring authentication as described below.
https://websocket-client.readthedocs.io/en/latest/examples.html#connecting-through-a-proxy

but that attribute is not involved in below code:

return {
"proxy_type": parsed.scheme,
"http_proxy_host": parsed.hostname,
"http_proxy_port": parsed.port,
}

then it raises 407 error as following:

  File "/usr/local/lib/python3.11/site-packages/ripe/atlas/cousteau/stream.py", line 135, in connect
    self.ws = websocket.create_connection(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websocket/_core.py", line 601, in create_connection
    websock.connect(url, **options)
  File "/usr/local/lib/python3.11/site-packages/websocket/_core.py", line 244, in connect
    self.sock, addrs = connect(url, self.sock_opt, proxy_info(**options),
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websocket/_http.py", line 132, in connect
    sock = _tunnel(sock, hostname, port, auth)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websocket/_http.py", line 299, in _tunnel
    raise WebSocketProxyException(
websocket._exceptions.WebSocketProxyException: failed CONNECT via proxy status: 407
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant