• Home
Name
Date
Size
#Lines
LOC

..--

src/main/java/com/squareup/okhttp/03-May-2024-1,220746

README.mdD03-May-2024627 2317

pom.xmlD03-May-20241.1 KiB3832

README.md

1 OkHttp Web Sockets
2 ==================
3 
4 RFC6455-compliant web socket implementation.
5 
6 Create a `WebSocketCall` with a `Request` and an `OkHttpClient` instance.
7 ```java
8 WebSocketCall call = WebSocketCall.create(client, request);
9 ```
10 
11 A `WebSocketListener` will notify of the initial connection, server-sent messages, and any failures
12 on the connection.
13 
14 Start the web socket by calling `enqueue` on `WebSocketCall` with the `WebSocketListener`.
15 ```java
16 call.enqueue(new WebSocketListener() {
17   // ...
18 });
19 ```
20 
21 *Note: This module's API should be considered experimental and may be subject to breaking changes
22 in future releases.*
23