Establishing the Websocket with Client Portal Gateway

View as MarkdownOpen in Claude

Next, you will need to build your websocket to wss://localhost:5000/v1/api/ws. In your request to establish the websocket, be sure to set your cookie header as “api={‘session’ value here}”

ws = websocket.WebSocketApp(
url="wss://localhost:5000/v1/api/ws",
on_open=on_open,
on_message=on_message,
on_error=on_error,
on_close=on_close,
cookie=f"api={sessionToken}"
)
ws.run_forever()