mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-10-25 18:40:12 -04:00
allow setting target protocol type to ws or wss
This commit is contained in:
parent
03d7b669ae
commit
5802671e0d
1 changed files with 2 additions and 2 deletions
|
|
@ -34,6 +34,7 @@ class WebsocketClientInterface(Interface):
|
|||
self.name = ifconf.get("name")
|
||||
self.target_host = ifconf.get("target_host", None)
|
||||
self.target_port = ifconf.get("target_port", None)
|
||||
self.target_type = ifconf.get("target_type", "ws")
|
||||
|
||||
# ensure target host is provided
|
||||
if self.target_host is None:
|
||||
|
|
@ -87,8 +88,7 @@ class WebsocketClientInterface(Interface):
|
|||
|
||||
# connect to websocket server
|
||||
try:
|
||||
# todo: ws:// and wss:// support in config file?
|
||||
self.websocket = connect(f"ws://{self.target_host}:{self.target_port}", max_size=None, compression=None)
|
||||
self.websocket = connect(f"{self.target_type}://{self.target_host}:{self.target_port}", max_size=None, compression=None)
|
||||
self.read_loop()
|
||||
except Exception as e:
|
||||
RNS.log(f"{self} failed with error: {e}", RNS.LOG_ERROR)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue