@@ -31,17 +31,18 @@ RESPONSE:
3131``` http
3232HTTP/1.1 200 OK
3333...
34- Updates-Via: wss://example.org/
34+ Updates-Via: wss://example.org/?access_token=Ne3jiZ1Mei6Air6iefoh
3535```
3636
37+ The URL mentioned in the ` Updates-Via ` header should act as a [ capability] ( https://en.wikipedia.org/wiki/Capability-based_security ) .
3738To subscribe to a resource, clients will need to send the keyword ` sub ` followed
3839by an empty space and then the URI of the resource:
3940
4041```
4142sub https://example.org/data/test
4243```
4344
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
4546receive a WebSocket message composed of the keyword ` pub ` , followed by an empty
4647space and the URI of the resource that has changed:
4748
@@ -50,9 +51,10 @@ pub https://example.org/data/test
5051```
5152
5253Subscribing 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
5455a 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.
5658
5759For example, a client subscribes to the ` data/ ` container:
5860
@@ -75,6 +77,10 @@ Then the following notification message will be sent:
7577pub https://example.org/data/
7678```
7779
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+
7884Here is a Javascript example on how to subscribe to live updates for a ` test `
7985resource at ` https://example.org/data/test ` :
8086
0 commit comments