Add websocket handler on server, connect from client

Additionally add /test handler that triggers server->client WS message
This commit is contained in:
2025-04-14 20:46:52 -07:00
parent b2c73ffa15
commit f2042f284e
9 changed files with 357 additions and 19 deletions

75
Cargo.lock generated
View File

@@ -448,6 +448,40 @@ dependencies = [
"tracing",
]
[[package]]
name = "axum-extra"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45bf463831f5131b7d3c756525b305d40f1185b688565648a92e1392ca35713d"
dependencies = [
"axum 0.8.3",
"axum-core 0.5.2",
"bytes 1.10.1",
"futures-util",
"headers",
"http 1.3.1",
"http-body 1.0.1",
"http-body-util",
"mime",
"pin-project-lite",
"rustversion",
"serde",
"tower 0.5.2",
"tower-layer",
"tower-service",
]
[[package]]
name = "axum-macros"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "604fde5e028fea851ce1d8570bbdc034bec850d157f7569d10f347d06808c05c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.100",
]
[[package]]
name = "backtrace"
version = "0.3.74"
@@ -1952,6 +1986,19 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2"
[[package]]
name = "gloo-console"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a17868f56b4a24f677b17c8cb69958385102fa879418052d60b50bc1727e261"
dependencies = [
"gloo-utils 0.2.0",
"js-sys",
"serde",
"wasm-bindgen",
"web-sys",
]
[[package]]
name = "gloo-events"
version = "0.1.2"
@@ -2228,6 +2275,30 @@ dependencies = [
"num-traits",
]
[[package]]
name = "headers"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "322106e6bd0cba2d5ead589ddb8150a13d7c4217cf80d7c4f682ca994ccc6aa9"
dependencies = [
"base64 0.21.7",
"bytes 1.10.1",
"headers-core",
"http 1.3.1",
"httpdate",
"mime",
"sha1",
]
[[package]]
name = "headers-core"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4"
dependencies = [
"http 1.3.1",
]
[[package]]
name = "heck"
version = "0.4.1"
@@ -2977,6 +3048,8 @@ dependencies = [
"async-graphql-axum",
"async-trait",
"axum 0.8.3",
"axum-extra",
"axum-macros",
"build-info",
"build-info-build",
"cacher",
@@ -2984,6 +3057,7 @@ dependencies = [
"clap",
"css-inline",
"futures 0.3.31",
"headers",
"html-escape",
"letterbox-notmuch",
"letterbox-shared",
@@ -3027,6 +3101,7 @@ dependencies = [
"chrono",
"console_error_panic_hook",
"console_log",
"gloo-console",
"gloo-net",
"graphql_client",
"human_format",