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

Socket error: 407: Proxy Authentication Required #863

Open
henzycuong1 opened this issue Sep 18, 2024 · 1 comment
Open

Socket error: 407: Proxy Authentication Required #863

henzycuong1 opened this issue Sep 18, 2024 · 1 comment
Labels
Status: Available No one has claimed responsibility for resolving this issue.

Comments

@henzycuong1
Copy link

henzycuong1 commented Sep 18, 2024

code:

mqtt_client = mqtt.Client(CallbackAPIVersion.VERSION2, protocol=MQTTProtocolVersion.MQTTv5, transport='websockets')
mqtt_client.proxy_set(proxy_type=socks.HTTP, proxy_addr='116.97.15.46', proxy_port=21433, proxy_username='61mdQQwpOX', proxy_password='vZxDiS')
mqtt_client.connect("wss.***.***", 443)

error:

File "c:\Users\Four\AppData\Local\Programs\Python\Python310\lib\site-packages\paho\mqtt\client.py", line 1435, in connect
    return self.reconnect()
  File "c:\Users\Four\AppData\Local\Programs\Python\Python310\lib\site-packages\paho\mqtt\client.py", line 1598, in reconnect
    self._sock = self._create_socket()
  File "c:\Users\Four\AppData\Local\Programs\Python\Python310\lib\site-packages\paho\mqtt\client.py", line 4609, in _create_socket
    sock = self._create_socket_connection()
  File "c:\Users\Four\AppData\Local\Programs\Python\Python310\lib\site-packages\paho\mqtt\client.py", line 4638, in _create_socket_connection
    return socks.create_connection(addr, timeout=self._connect_timeout, source_address=source, **proxy)
  File "c:\Users\Four\AppData\Local\Programs\Python\Python310\lib\site-packages\socks.py", line 209, in create_connection
    raise err
  File "c:\Users\Four\AppData\Local\Programs\Python\Python310\lib\site-packages\socks.py", line 199, in create_connection
    sock.connect((remote_host, remote_port))
  File "c:\Users\Four\AppData\Local\Programs\Python\Python310\lib\site-packages\socks.py", line 47, in wrapper
    return function(*args, **kwargs)
  File "c:\Users\Four\AppData\Local\Programs\Python\Python310\lib\site-packages\socks.py", line 814, in connect
    raise GeneralProxyError("Socket error", error)
socks.GeneralProxyError: Socket error: 407: Proxy Authentication Required

proxy is still alive and uses the requests as usual

@github-actions github-actions bot added the Status: Available No one has claimed responsibility for resolving this issue. label Sep 18, 2024
@henzycuong1
Copy link
Author

Fixed:
Change
Proxy-Authorization: basic to Proxy-Authorization: Basic in socks.py line 679

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Available No one has claimed responsibility for resolving this issue.
Projects
None yet
Development

No branches or pull requests

1 participant