Portal link: send the instance credential as Authorization: Bearer
Not ?token= in the tunnel URL, which access logs keep. The hub has to be upgraded first; websockets>=14 for additional_headers on the asyncio client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013GAeg4Jo6xjZzjwy9QDWMQ
This commit is contained in:
@@ -191,9 +191,12 @@ class CloudConnector:
|
||||
import websockets
|
||||
|
||||
attached = False
|
||||
url = f"{config.ws_url}?token={config.token}"
|
||||
# A header rather than `?token=`, since a URL ends up in access logs.
|
||||
# A hub from before the header reads only the query: upgrade the hub
|
||||
# before its instances.
|
||||
async with websockets.connect(
|
||||
url,
|
||||
config.ws_url,
|
||||
additional_headers={"Authorization": f"Bearer {config.token}"},
|
||||
max_size=MAX_WS_MESSAGE,
|
||||
ping_interval=PING_INTERVAL_S,
|
||||
ping_timeout=PING_TIMEOUT_S,
|
||||
|
||||
Reference in New Issue
Block a user