1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-07-21 11:38:20 +00:00

WebSockets via Rocket's Upgrade connection

This PR implements a (not yet fully released) new feature of Rocket which allows WebSockets/Upgrade connections.
No more need for multiple ports to be opened for Vaultwarden.
No explicit need for a reverse proxy to get WebSockets to work (Although I still suggest to use a reverse proxy).

- Using a git revision for Rocket, since `rocket_ws` is not yet released.
- Updated other crates as well.
- Added a connection guard to clear the WS connection from the Users list.

Fixes #685
Fixes #2917
Fixes #1424
This commit is contained in:
BlackDex 2023-03-30 17:18:59 +02:00
commit 3d11f4cd16
No known key found for this signature in database
GPG key ID: 58C80A2AA6C765E1
3 changed files with 343 additions and 191 deletions

View file

@ -56,6 +56,8 @@ num-derive = "0.3.3"
# Web framework
rocket = { version = "0.5.0-rc.3", features = ["tls", "json"], default-features = false }
# rocket_ws = { version ="0.1.0-rc.3" }
rocket_ws = { git = 'https://github.com/SergioBenitez/Rocket', rev = "a82508b403420bd941c32ddec3ee3e4875f2b8a5" }
# WebSockets libraries
tokio-tungstenite = "0.18.0"
@ -85,11 +87,11 @@ rand = { version = "0.8.5", features = ["small_rng"] }
ring = "0.16.20"
# UUID generation
uuid = { version = "1.3.0", features = ["v4"] }
uuid = { version = "1.3.1", features = ["v4"] }
# Date and time libraries
chrono = { version = "0.4.24", features = ["clock", "serde"], default-features = false }
chrono-tz = "0.8.1"
chrono-tz = "0.8.2"
time = "0.3.20"
# Job scheduler
@ -114,7 +116,7 @@ webauthn-rs = "0.3.2"
url = "2.3.1"
# Email libraries
lettre = { version = "0.10.3", features = ["smtp-transport", "sendmail-transport", "builder", "serde", "tokio1-native-tls", "hostname", "tracing", "tokio1"], default-features = false }
lettre = { version = "0.10.4", features = ["smtp-transport", "sendmail-transport", "builder", "serde", "tokio1-native-tls", "hostname", "tracing", "tokio1"], default-features = false }
percent-encoding = "2.2.0" # URL encoding library used for URL's in the emails
email_address = "0.2.4"
@ -138,7 +140,7 @@ cookie = "0.16.2"
cookie_store = "0.19.0"
# Used by U2F, JWT and PostgreSQL
openssl = "0.10.48"
openssl = "0.10.50"
# CLI argument parsing
pico-args = "0.5.0"
@ -152,8 +154,7 @@ semver = "1.0.17"
# Allow overriding the default memory allocator
# Mainly used for the musl builds, since the default musl malloc is very slow
mimalloc = { version = "=0.1.34", features = ["secure"], default-features = false, optional = true }
libmimalloc-sys = "=0.1.30"
mimalloc = { version = "0.1.36", features = ["secure"], default-features = false, optional = true }
which = "4.4.0"
# Argon2 library with support for the PHC format
@ -162,6 +163,10 @@ argon2 = "0.5.0"
# Reading a password from the cli for generating the Argon2id ADMIN_TOKEN
rpassword = "7.2.0"
[patch.crates-io]
rocket = { git = 'https://github.com/SergioBenitez/Rocket', rev = 'a82508b403420bd941c32ddec3ee3e4875f2b8a5' }
# rocket_ws = { git = 'https://github.com/SergioBenitez/Rocket', rev = 'a82508b403420bd941c32ddec3ee3e4875f2b8a5' }
# Strip debuginfo from the release builds
# Also enable thin LTO for some optimizations
[profile.release]