Open Vincent-299 opened 1 year ago
I looked into the code, there is no proxy support for websocket,
Thx @oliver-zehentleitner . I think there is setting for websocket proxy. Here is the reason: For the following codes: twm = ThreadedWebsocketManager(requests_params={'proxy':proxies}, testnet=False) if I set testnet=False, I can't receive message for binance, but if i set testnet=True, I can receive data from testnet.
Testnet has nothing to do with proxy. For Testnet only another URI is used at the websocket start. A proxy connection works differently and is definitely not implemented in the code here.
Here you have an alternative, if you want it: https://medium.lucit.tech/how-to-connect-to-binance-com-websockets-using-python-via-a-socks5-proxy-3c5a3e063f12
Thanks lot @oliver-zehentleitner . I'll look into it.
could it be enhanced to support proxy in python-binance.
Describe the bug There is no response when I set the proxy as following: twm = ThreadedWebsocketManager(api_key=api_key, api_secret=api_secret, requests_params={'proxy':proxies})
If I set testnet=True, I don't need set the proxy, and it works. twm = ThreadedWebsocketManager(api_key=api_key, api_secret=api_secret, testnet=True) To Reproduce proxies = 'http://127.0.0.1:xxxx' twm = ThreadedWebsocketManager(api_key=api_key, api_secret=api_secret, requests_params={'proxy':proxies})
Environment (please complete the following information):
Logs or Additional context Add any other context about the problem here.