WebSocket Notifications
Real-time notifications for resource changes using the solid-0.1 protocol (SolidOS compatible).
jss start --notifications
Discovery
Clients discover the WebSocket URL via the Updates-Via header:
curl -I http://localhost:3000/alice/public/
# Updates-Via: ws://localhost:3000/.notificationsProtocol
Server: protocol solid-0.1
Client: sub http://localhost:3000/alice/public/data.json
Server: ack http://localhost:3000/alice/public/data.json
Server: pub http://localhost:3000/alice/public/data.json (on change)
How It Works
- Client connects to the WebSocket URL from
Updates-Via - Server sends
protocol solid-0.1greeting - Client subscribes:
sub <resource-url> - Server acknowledges:
ack <resource-url> - On any change (PUT, PATCH, DELETE), server broadcasts:
pub <resource-url> - Container subscriptions also fire when child resources change
ACL Enforcement
- Anonymous clients can subscribe to public resources
- Private resource subscriptions require authentication
- Cross-origin subscriptions are rejected
Live Reload
For development, --live-reload injects a script that auto-refreshes the browser when files change on disk:
jss start --live-reload --notifications
File system changes (editing files directly) also trigger WebSocket notifications.