unplugged-system/external/okhttp/okhttp-ws
2025-10-06 13:59:42 +00:00
..
src/main/java/com/squareup/okhttp Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00
pom.xml Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00
README.md Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00

OkHttp Web Sockets

RFC6455-compliant web socket implementation.

Create a WebSocketCall with a Request and an OkHttpClient instance.

WebSocketCall call = WebSocketCall.create(client, request);

A WebSocketListener will notify of the initial connection, server-sent messages, and any failures on the connection.

Start the web socket by calling enqueue on WebSocketCall with the WebSocketListener.

call.enqueue(new WebSocketListener() {
  // ...
});

Note: This module's API should be considered experimental and may be subject to breaking changes in future releases.