Skip to content
This repository has been archived by the owner on Mar 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #157 from AyliD/patch-1
Browse files Browse the repository at this point in the history
Update ws_client.py to support proxy
  • Loading branch information
k8s-ci-robot committed Sep 24, 2019
2 parents af42f24 + 34f3d05 commit 6ca7a5b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion stream/ws_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ def __init__(self, configuration, url, headers):
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):
Expand Down

0 comments on commit 6ca7a5b

Please sign in to comment.