mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-21 02:01:31 +00:00
don't compute the url, it doesn't seem to be necessary
This commit is contained in:
parent
9c7e93e924
commit
edf01d7817
@ -70,14 +70,14 @@ class TokenAuthenticatedWebSocketServerProtocol(WebSocketServerProtocol):
|
||||
pass
|
||||
|
||||
|
||||
def create_log_streaming_resource(client, websocket_url):
|
||||
def create_log_streaming_resource(client):
|
||||
"""
|
||||
Create a new resource that accepts WebSocket connections if they
|
||||
include a correct `Authorization: tahoe-lafs <api_auth_token>`
|
||||
header (where `api_auth_token` matches the private configuration
|
||||
value).
|
||||
"""
|
||||
factory = WebSocketServerFactory(websocket_url)
|
||||
factory = WebSocketServerFactory()
|
||||
factory.tahoe_client = client
|
||||
factory.protocol = TokenAuthenticatedWebSocketServerProtocol
|
||||
return WebSocketResource(factory)
|
||||
|
@ -171,16 +171,7 @@ class Root(MultiFormatPage):
|
||||
self.child_magic_folder = magic_folder.MagicFolderWebApi(client)
|
||||
|
||||
# handler for "/logs_v1" URIs
|
||||
# note, webport can be a bare port or a Twisted
|
||||
# endpoint-string but running it through serverFromString
|
||||
# requires the reactor and still doesn't gain us anything
|
||||
# (there's still no public API for "what is the port")
|
||||
if webport.startswith("tcp:"):
|
||||
port = webport.split(':')[1]
|
||||
else:
|
||||
port = webport
|
||||
websocket_url = u"ws://127.0.0.1:{}/logs_v1".format(port)
|
||||
self.child_logs_v1 = create_log_streaming_resource(client, websocket_url)
|
||||
self.child_logs_v1 = create_log_streaming_resource(client)
|
||||
|
||||
self.child_file = FileHandler(client)
|
||||
self.child_named = FileHandler(client)
|
||||
|
Loading…
x
Reference in New Issue
Block a user