diff --git a/stream/ws_client.py b/stream/ws_client.py index 935c98852..7f0412060 100644 --- a/stream/ws_client.py +++ b/stream/ws_client.py @@ -76,7 +76,11 @@ class WSClient: ssl_opts['keyfile'] = configuration.key_file self.sock = WebSocket(sslopt=ssl_opts, skip_utf8_validation=False) - self.sock.connect(url, header=header) + 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 def peek_channel(self, channel, timeout=0):