@@ -31,17 +31,18 @@ RESPONSE:
31
31
``` http
32
32
HTTP/1.1 200 OK
33
33
...
34
- Updates-Via: wss://example.org/
34
+ Updates-Via: wss://example.org/?access_token=Ne3jiZ1Mei6Air6iefoh
35
35
```
36
36
37
+ The URL mentioned in the ` Updates-Via ` header should act as a [ capability] ( https://en.wikipedia.org/wiki/Capability-based_security ) .
37
38
To subscribe to a resource, clients will need to send the keyword ` sub ` followed
38
39
by an empty space and then the URI of the resource:
39
40
40
41
```
41
42
sub https://example.org/data/test
42
43
```
43
44
44
- If a change occurs and the client is subscribed to that resource, it will
45
+ If a change occurs and the client is subscribed to that resource and has Read access to it , it will
45
46
receive a WebSocket message composed of the keyword ` pub ` , followed by an empty
46
47
space and the URI of the resource that has changed:
47
48
@@ -50,9 +51,10 @@ pub https://example.org/data/test
50
51
```
51
52
52
53
Subscribing to a container can also be really useful, since all CRUD operations
53
- (POST, PUT, PATCH, DELETE) performed on resources of that container will trigger
54
+ (POST, PUT, PATCH, DELETE) performed on member resources of that container will trigger
54
55
a notification for the container URI. This makes synchronization between
55
- multiple apps really easy.
56
+ multiple apps really easy. It only affects the parent container, of which the resource is a member,
57
+ not further ancestor containers.
56
58
57
59
For example, a client subscribes to the ` data/ ` container:
58
60
@@ -75,6 +77,10 @@ Then the following notification message will be sent:
75
77
pub https://example.org/data/
76
78
```
77
79
80
+ The server may send additional informational messages for e.g. error reporting,
81
+ as long as they don't start with ` pub ` .
82
+ If a client subscribes to too many updates, the server may close the socket.
83
+
78
84
Here is a Javascript example on how to subscribe to live updates for a ` test `
79
85
resource at ` https://example.org/data/test ` :
80
86
0 commit comments