mirror of
https://github.com/google/bumble.git
synced 2026-05-09 04:08:02 +00:00
Merge pull request #297 from google/gbg/websocket-full-url
ws-client: make implementation match the doc
This commit is contained in:
@@ -31,14 +31,12 @@ async def open_ws_client_transport(spec: str) -> Transport:
|
|||||||
'''
|
'''
|
||||||
Open a WebSocket client transport.
|
Open a WebSocket client transport.
|
||||||
The parameter string has this syntax:
|
The parameter string has this syntax:
|
||||||
<remote-host>:<remote-port>
|
<websocket-url>
|
||||||
|
|
||||||
Example: 127.0.0.1:9001
|
Example: ws://localhost:7681/v1/websocket/bt
|
||||||
'''
|
'''
|
||||||
|
|
||||||
remote_host, remote_port = spec.split(':')
|
websocket = await websockets.client.connect(spec)
|
||||||
uri = f'ws://{remote_host}:{remote_port}'
|
|
||||||
websocket = await websockets.client.connect(uri)
|
|
||||||
|
|
||||||
transport = PumpedTransport(
|
transport = PumpedTransport(
|
||||||
PumpedPacketSource(websocket.recv),
|
PumpedPacketSource(websocket.recv),
|
||||||
|
|||||||
Reference in New Issue
Block a user