Skip to content

Add WebSocket signaling for WebRTC connections#2239

Open
larsers wants to merge 1 commit intogoogle:mainfrom
larsers:pr/websocket-signaling
Open

Add WebSocket signaling for WebRTC connections#2239
larsers wants to merge 1 commit intogoogle:mainfrom
larsers:pr/websocket-signaling

Conversation

@larsers
Copy link

@larsers larsers commented Mar 9, 2026

Add WebSocket-based signaling as a faster alternative to HTTP long-polling for WebRTC connections between the browser client and the Cuttlefish operator.

Key changes:

  • Add WsClient type implementing the Client interface with goroutine-based read/write pumps and ping/pong keepalive
  • Add GET /devices/{deviceId}/connect WebSocket upgrade endpoint
  • Add WebSocketConnector JavaScript class that tries WebSocket first and falls back to HTTP polling if unavailable
  • Full backward compatibility: existing polling connections continue to work unchanged

Uses the existing gorilla/websocket dependency (already used for the ADB WebSocket proxy).

Add WebSocket-based signaling as a faster alternative to HTTP
long-polling for WebRTC connections between the browser client
and the Cuttlefish operator.

Key changes:
- Add WsClient type implementing the Client interface with
  goroutine-based read/write pumps and ping/pong keepalive
- Add GET /devices/{deviceId}/connect WebSocket upgrade endpoint
- Add WebSocketConnector JavaScript class that tries WebSocket
  first and falls back to HTTP polling if unavailable
- Full backward compatibility: existing polling connections
  continue to work unchanged

Uses the existing gorilla/websocket dependency (already used for
the ADB WebSocket proxy).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants