Initial version of websockets notification support.
For now only folder notifications are sent (create, rename, delete). The notifications are only tested between two web-vault sessions in different browsers, mobile apps and browser extensions are untested. The websocket server is exposed in port 3012, while the rocket server is exposed in another port (8000 by default). To make notifications work, both should be accessible in the same port, which requires a reverse proxy. My testing is done with Caddy server, and the following config: ``` localhost { # The negotiation endpoint is also proxied to Rocket proxy /notifications/hub/negotiate 0.0.0.0:8000 { transparent } # Notifications redirected to the websockets server proxy /notifications/hub 0.0.0.0:3012 { websocket } # Proxy the Root directory to Rocket proxy / 0.0.0.0:8000 { transparent } } ``` This exposes the service in port 2015.
Showing
- Cargo.lock 391 additions, 146 deletionsCargo.lock
- Cargo.toml 16 additions, 3 deletionsCargo.toml
- src/api/core/folders.rs 15 additions, 9 deletionssrc/api/core/folders.rs
- src/api/mod.rs 1 addition, 0 deletionssrc/api/mod.rs
- src/api/notifications.rs 333 additions, 5 deletionssrc/api/notifications.rs
- src/db/models/folder.rs 2 additions, 2 deletionssrc/db/models/folder.rs
- src/main.rs 7 additions, 3 deletionssrc/main.rs
Loading
Please register or sign in to comment