Update ws_client.py to support proxy
@@ -74,6 +74,10 @@ class WSClient:
ssl_opts['keyfile'] = configuration.key_file
self.sock = WebSocket(sslopt=ssl_opts, skip_utf8_validation=False)
+ if configuration.proxy:
+ proxy_url = urlparse(configuration.proxy)
+ self.sock.connect(url, header=header, http_proxy_host=proxy_url.hostname, http_proxy_port=proxy_url.port)
+ else:
self.sock.connect(url, header=header)
self._connected = True
