From bd06fad7e7d805276f1f90ec6c201c5c6488d7b8 Mon Sep 17 00:00:00 2001 From: meejah Date: Wed, 14 Apr 2021 16:58:05 -0600 Subject: [PATCH] websocket defaults test --- src/wormhole_transit_relay/server_tap.py | 2 +- src/wormhole_transit_relay/test/test_config.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wormhole_transit_relay/server_tap.py b/src/wormhole_transit_relay/server_tap.py index a54082b..8198674 100644 --- a/src/wormhole_transit_relay/server_tap.py +++ b/src/wormhole_transit_relay/server_tap.py @@ -70,9 +70,9 @@ def makeService(config, reactor=reactor): print("Using WebSocket URL '{}'".format(ws_url)) ws_factory = WebSocketServerFactory(ws_url) ws_factory.protocol = transit_server.WebSocketTransitConnection + ws_factory.transit = transit tcp_factory.transit = transit - ws_factory.transit = transit parent = MultiService() StreamServerEndpointService(tcp_ep, tcp_factory).setServiceParent(parent) if ws_ep is not None: diff --git a/src/wormhole_transit_relay/test/test_config.py b/src/wormhole_transit_relay/test/test_config.py index 72aa7ec..0b014d2 100644 --- a/src/wormhole_transit_relay/test/test_config.py +++ b/src/wormhole_transit_relay/test/test_config.py @@ -9,12 +9,14 @@ class Config(unittest.TestCase): o = server_tap.Options() o.parseOptions([]) self.assertEqual(o, {"blur-usage": None, "log-fd": None, - "usage-db": None, "port": PORT}) + "usage-db": None, "port": PORT, + "websocket": None, "websocket-url": None}) def test_blur(self): o = server_tap.Options() o.parseOptions(["--blur-usage=60"]) self.assertEqual(o, {"blur-usage": 60, "log-fd": None, - "usage-db": None, "port": PORT}) + "usage-db": None, "port": PORT, + "websocket": None, "websocket-url": None}) def test_string(self): o = server_tap.Options()