add proxy argument in open_connections() (#42)

Co-Authored-By: Jeff Thibault <jdthibault2@gmail.com>
This commit is contained in:
/dev/fd0
2023-01-27 00:03:44 +05:30
committed by GitHub
parent 8eda01180c
commit b105e650b3
2 changed files with 8 additions and 4 deletions

View File

@@ -37,8 +37,12 @@ class Relay:
on_error=self._on_error,
on_close=self._on_close)
def connect(self, ssl_options: dict=None):
self.ws.run_forever(sslopt=ssl_options)
def connect(self, ssl_options: dict=None, proxy: dict=None):
self.ws.run_forever(
sslopt=ssl_options,
http_proxy_host=None if proxy is None else proxy.get('host'),
http_proxy_port=None if proxy is None else proxy.get('port')
)
def close(self):
self.ws.close()