Merge branch 'main' of https://github.com/jeffthibault/python-nostr into jeffthibault-main

This commit is contained in:
callebtc
2023-02-02 16:27:30 +01:00
18 changed files with 896 additions and 89 deletions

View File

@@ -44,9 +44,14 @@ class Relay:
on_close=self._on_close,
)
def connect(self, ssl_options: dict = {}):
def connect(self, ssl_options: dict=None, proxy: dict=None):
self.ssl_options = ssl_options
self.ws.run_forever(sslopt=self.ssl_options)
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'),
proxy_type=None if proxy is None else proxy.get('type')
)
def close(self):
self.ws.close()