Skip to content
This repository was archived by the owner on Apr 13, 2022. It is now read-only.

Commit cbc18c9

Browse files
committed
Let clients indicate the protocol version.
1 parent 403c9aa commit cbc18c9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

api-websockets.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ Updates-Via: wss://example.org
4141
### Connection
4242
Then, the client needs to open a WebSocket connection
4343
to that URI.
44+
The client _SHOULD_ include the protocol version `solid-ws-draft/v0.1.0-alpha`
45+
in the `Sec-WebSocket-Protocol` header.
4446

4547
For example, in JavaScript, this could be done as follows:
4648

4749
```
48-
const socket = new WebSocket('wss://example.org');
50+
const socket = new WebSocket('wss://example.org', ['solid-ws-draft/v0.1.0-alpha']);
4951
```
5052

5153
### Subscription
@@ -101,7 +103,7 @@ Here is a Javascript example on how to subscribe to live updates for a `test`
101103
resource at `https://example.org/data/test`:
102104

103105
```js
104-
var socket = new WebSocket('wss://example.org/');
106+
var socket = new WebSocket('wss://example.org/', ['solid-ws-draft/v0.1.0-alpha']);
105107
socket.onopen = function() {
106108
this.send('sub https://example.org/data/test');
107109
};

0 commit comments

Comments
 (0)