diff --git a/Cargo.lock b/Cargo.lock index cbefd4c..53fdd55 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,6 +23,41 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + [[package]] name = "ahash" version = "0.8.11" @@ -73,45 +108,6 @@ dependencies = [ "zbus", ] -[[package]] -name = "asn1-rs" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" -dependencies = [ - "asn1-rs-derive", - "asn1-rs-impl", - "displaydoc", - "nom", - "num-traits", - "rusticata-macros", - "thiserror", - "time", -] - -[[package]] -name = "asn1-rs-derive" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", - "synstructure", -] - -[[package]] -name = "asn1-rs-impl" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "async-broadcast" version = "0.7.1" @@ -306,85 +302,6 @@ dependencies = [ "paste", ] -[[package]] -name = "axum" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" -dependencies = [ - "async-trait", - "axum-core", - "bytes", - "futures-util", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-util", - "itoa 1.0.11", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sync_wrapper 1.0.1", - "tokio", - "tower 0.5.1", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "axum-core" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http", - "http-body", - "http-body-util", - "mime", - "pin-project-lite", - "rustversion", - "sync_wrapper 1.0.1", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "axum-server" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56bac90848f6a9393ac03c63c640925c4b7c8ca21654de40d53f55964667c7d8" -dependencies = [ - "arc-swap", - "bytes", - "futures-util", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-util", - "pin-project-lite", - "rustls 0.23.16", - "rustls-pemfile 2.2.0", - "rustls-pki-types", - "tokio", - "tokio-rustls", - "tower 0.4.13", - "tower-service", -] - [[package]] name = "backtrace" version = "0.3.71" @@ -429,7 +346,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", "syn 2.0.87", "which", @@ -516,7 +433,7 @@ dependencies = [ "glib", "libc", "once_cell", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -583,6 +500,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "ciborium" version = "0.2.2" @@ -610,6 +533,16 @@ dependencies = [ "half", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + [[package]] name = "clang-sys" version = "1.8.1" @@ -641,7 +574,7 @@ dependencies = [ "cocoa-foundation 0.1.2", "core-foundation 0.9.4", "core-graphics 0.23.2", - "foreign-types", + "foreign-types 0.5.0", "libc", "objc", ] @@ -657,7 +590,7 @@ dependencies = [ "cocoa-foundation 0.2.0", "core-foundation 0.10.0", "core-graphics 0.24.0", - "foreign-types", + "foreign-types 0.5.0", "libc", "objc", ] @@ -781,6 +714,23 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "cookie" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +dependencies = [ + "aes-gcm", + "base64 0.22.1", + "hmac", + "percent-encoding", + "rand 0.8.5", + "sha2", + "subtle", + "time", + "version_check", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -816,7 +766,7 @@ dependencies = [ "bitflags 1.3.2", "core-foundation 0.9.4", "core-graphics-types 0.1.3", - "foreign-types", + "foreign-types 0.5.0", "libc", ] @@ -829,7 +779,7 @@ dependencies = [ "bitflags 2.6.0", "core-foundation 0.10.0", "core-graphics-types 0.2.0", - "foreign-types", + "foreign-types 0.5.0", "libc", ] @@ -901,6 +851,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", + "rand_core 0.6.4", "typenum", ] @@ -931,6 +882,15 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + [[package]] name = "darling" version = "0.20.10" @@ -984,20 +944,6 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" -[[package]] -name = "der-parser" -version = "9.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" -dependencies = [ - "asn1-rs", - "displaydoc", - "nom", - "num-bigint", - "num-traits", - "rusticata-macros", -] - [[package]] name = "deranged" version = "0.3.11" @@ -1005,6 +951,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", + "serde", ] [[package]] @@ -1039,6 +986,7 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", + "subtle", ] [[package]] @@ -1091,7 +1039,7 @@ dependencies = [ "futures-util", "generational-box", "longest-increasing-subsequence", - "rustc-hash", + "rustc-hash 1.1.0", "rustversion", "serde", "slab", @@ -1152,13 +1100,13 @@ dependencies = [ "objc_id", "once_cell", "rfd", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", "signal-hook", "slab", "tao", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", "tray-icon", @@ -1179,7 +1127,7 @@ dependencies = [ "serde", "serde_json", "tracing", - "tungstenite", + "tungstenite 0.23.0", "warnings", ] @@ -1312,7 +1260,7 @@ dependencies = [ "dioxus-html", "js-sys", "lazy-js-bundle", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "sledgehammer_bindgen", "sledgehammer_utils", @@ -1390,7 +1338,7 @@ dependencies = [ "generational-box", "once_cell", "parking_lot", - "rustc-hash", + "rustc-hash 1.1.0", "tracing", "warnings", ] @@ -1431,7 +1379,7 @@ dependencies = [ "generational-box", "js-sys", "lazy-js-bundle", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde-wasm-bindgen 0.5.0", "serde_json", @@ -1620,6 +1568,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "etag" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b3d0661a2ccddc26cba0b834e9b717959ed6fdd76c7129ee159c170a875bf44" +dependencies = [ + "str-buf", + "xxhash-rust", +] + [[package]] name = "euclid" version = "0.22.11" @@ -1702,6 +1660,15 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared 0.1.1", +] + [[package]] name = "foreign-types" version = "0.5.0" @@ -1709,7 +1676,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ "foreign-types-macros", - "foreign-types-shared", + "foreign-types-shared 0.3.1", ] [[package]] @@ -1723,6 +1690,12 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "foreign-types-shared" version = "0.3.1" @@ -2002,8 +1975,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "ghash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +dependencies = [ + "opaque-debug", + "polyval", ] [[package]] @@ -2028,7 +2013,7 @@ dependencies = [ "once_cell", "pin-project-lite", "smallvec", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2064,7 +2049,7 @@ dependencies = [ "memchr", "once_cell", "smallvec", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2109,7 +2094,7 @@ dependencies = [ "keyboard-types", "objc", "once_cell", - "thiserror", + "thiserror 1.0.69", "windows-sys 0.52.0", "x11-dl", ] @@ -2129,7 +2114,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -2279,6 +2264,30 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +[[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", + "headers-core", + "http", + "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", +] + [[package]] name = "heck" version = "0.4.1" @@ -2309,6 +2318,15 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "home" version = "0.5.9" @@ -2341,12 +2359,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "httlib-huffman" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9fcbcc408c5526c3ab80d534e5c86e7967c1fb7aa0a8c76abd1edc27deb877" - [[package]] name = "http" version = "1.1.0" @@ -2381,12 +2393,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "http-range-header" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a397c49fec283e3d6211adbe480be95aae5f304cfb923e9970e08956d5168a" - [[package]] name = "httparse" version = "1.9.5" @@ -2420,6 +2426,41 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-rustls" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "log", + "rustls", + "rustls-native-certs", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + [[package]] name = "hyper-util" version = "0.1.10" @@ -2619,6 +2660,15 @@ dependencies = [ "cfb", ] +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + [[package]] name = "instant" version = "0.1.13" @@ -2689,7 +2739,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.69", "walkdir", "windows-sys 0.45.0", ] @@ -2718,6 +2768,21 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonwebtoken" +version = "9.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" +dependencies = [ + "base64 0.21.7", + "js-sys", + "pem", + "ring", + "serde", + "serde_json", + "simple_asn1", +] + [[package]] name = "keyboard-types" version = "0.7.0" @@ -2892,7 +2957,7 @@ dependencies = [ "memchr", "mime", "selectors", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2995,12 +3060,6 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" -[[package]] -name = "matchit" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" - [[package]] name = "memchr" version = "2.7.4" @@ -3031,6 +3090,16 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "mime-infer" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91caed19dd472bc88bcd063571df18153529d49301a1918f4cf37f42332bee2e" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "mime_guess" version = "2.0.5" @@ -3098,7 +3167,7 @@ dependencies = [ "objc", "once_cell", "png", - "thiserror", + "thiserror 1.0.69", "windows-sys 0.52.0", ] @@ -3118,10 +3187,36 @@ dependencies = [ "objc2-foundation", "once_cell", "png", - "thiserror", + "thiserror 1.0.69", "windows-sys 0.59.0", ] +[[package]] +name = "multer" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" +dependencies = [ + "bytes", + "encoding_rs", + "futures-util", + "http", + "httparse", + "memchr", + "mime", + "spin", + "version_check", +] + +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" +dependencies = [ + "serde", +] + [[package]] name = "mumble-protocol-2x" version = "0.5.0" @@ -3185,22 +3280,35 @@ dependencies = [ name = "mumble-web2-proxy" version = "0.1.0" dependencies = [ - "axum", - "axum-server", "color-eyre", - "lazy_static", "mumble-web2-common", - "rustls-pemfile 2.2.0", + "once_cell", + "rustls", + "salvo", "serde", "serde_json", "tokio", "tokio-rustls", "toml", - "tower 0.5.1", - "tower-http", "tracing", "tracing-subscriber", - "wtransport", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", ] [[package]] @@ -3215,7 +3323,7 @@ dependencies = [ "ndk-sys", "num_enum", "raw-window-handle 0.6.2", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3251,6 +3359,18 @@ dependencies = [ "memoffset", ] +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "cfg_aliases", + "libc", +] + [[package]] name = "nodrop" version = "0.1.14" @@ -3337,7 +3457,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", "syn 2.0.87", @@ -3490,12 +3610,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "octets" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109983a091271ee8916076731ba5fdc9ee22fea871bc7c6ceab9bfd423eb1d99" - [[package]] name = "ogg" version = "0.9.1" @@ -3505,27 +3619,62 @@ dependencies = [ "byteorder", ] -[[package]] -name = "oid-registry" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9" -dependencies = [ - "asn1-rs", -] - [[package]] name = "once_cell" version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "openssl" +version = "0.10.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "foreign-types 0.3.2", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-sys" +version = "0.9.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "option-ext" version = "0.2.0" @@ -3623,6 +3772,12 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "path-slash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" + [[package]] name = "pem" version = "3.0.4" @@ -3820,6 +3975,18 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" +[[package]] +name = "polyval" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -3948,50 +4115,52 @@ dependencies = [ [[package]] name = "quinn" -version = "0.10.2" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" dependencies = [ "bytes", + "futures-io", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash", - "rustls 0.21.12", - "thiserror", + "rustc-hash 2.0.0", + "rustls", + "socket2", + "thiserror 1.0.69", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.10.6" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ "bytes", "rand 0.8.5", - "ring 0.16.20", - "rustc-hash", - "rustls 0.21.12", - "rustls-native-certs 0.6.3", + "ring", + "rustc-hash 2.0.0", + "rustls", "slab", - "thiserror", + "thiserror 1.0.69", "tinyvec", "tracing", ] [[package]] name = "quinn-udp" -version = "0.4.1" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" +checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" dependencies = [ - "bytes", + "cfg_aliases", "libc", + "once_cell", "socket2", "tracing", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -4096,19 +4265,6 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" -[[package]] -name = "rcgen" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54077e1872c46788540de1ea3d7f4ccb1983d12f9aa909b234468676c1a36779" -dependencies = [ - "pem", - "ring 0.17.8", - "rustls-pki-types", - "time", - "yasna", -] - [[package]] name = "redox_syscall" version = "0.5.7" @@ -4126,7 +4282,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom 0.2.15", "libredox", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4181,26 +4337,34 @@ checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "base64 0.22.1", "bytes", + "encoding_rs", "futures-core", "futures-util", + "h2", "http", "http-body", "http-body-util", "hyper", + "hyper-rustls", + "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", "mime_guess", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "sync_wrapper 1.0.1", + "system-configuration", "tokio", + "tokio-native-tls", "tokio-util", "tower-service", "url", @@ -4234,21 +4398,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - [[package]] name = "ring" version = "0.17.8" @@ -4259,8 +4408,8 @@ dependencies = [ "cfg-if", "getrandom 0.2.15", "libc", - "spin 0.9.8", - "untrusted 0.9.0", + "spin", + "untrusted", "windows-sys 0.52.0", ] @@ -4281,6 +4430,40 @@ dependencies = [ "tracing", ] +[[package]] +name = "rust-embed" +version = "8.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa66af4a4fdd5e7ebc276f115e895611a34739a9c1c01028383d612d550953c0" +dependencies = [ + "rust-embed-impl", + "rust-embed-utils", + "walkdir", +] + +[[package]] +name = "rust-embed-impl" +version = "8.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6125dbc8867951125eec87294137f4e9c2c96566e61bf72c45095a7c77761478" +dependencies = [ + "proc-macro2", + "quote", + "rust-embed-utils", + "syn 2.0.87", + "walkdir", +] + +[[package]] +name = "rust-embed-utils" +version = "8.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e5347777e9aacb56039b0e1f28785929a8a3b709e87482e7442c72e7c12529d" +dependencies = [ + "sha2", + "walkdir", +] + [[package]] name = "rustc-demangle" version = "0.1.24" @@ -4293,6 +4476,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustc_version" version = "0.4.1" @@ -4302,15 +4491,6 @@ dependencies = [ "semver", ] -[[package]] -name = "rusticata-macros" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" -dependencies = [ - "nom", -] - [[package]] name = "rustix" version = "0.38.40" @@ -4324,18 +4504,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rustls" -version = "0.21.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" -dependencies = [ - "log", - "ring 0.17.8", - "rustls-webpki 0.101.7", - "sct", -] - [[package]] name = "rustls" version = "0.23.16" @@ -4345,46 +4513,26 @@ dependencies = [ "aws-lc-rs", "log", "once_cell", + "ring", "rustls-pki-types", - "rustls-webpki 0.102.8", + "rustls-webpki", "subtle", "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.6.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.4", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-native-certs" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" -dependencies = [ - "openssl-probe", - "rustls-pemfile 2.2.0", + "rustls-pemfile", "rustls-pki-types", "schannel", "security-framework", ] -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - [[package]] name = "rustls-pemfile" version = "2.2.0" @@ -4400,16 +4548,6 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] - [[package]] name = "rustls-webpki" version = "0.102.8" @@ -4417,9 +4555,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "aws-lc-rs", - "ring 0.17.8", + "ring", "rustls-pki-types", - "untrusted 0.9.0", + "untrusted", ] [[package]] @@ -4434,6 +4572,190 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +[[package]] +name = "salvo" +version = "0.74.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a941a79d92a35187603ddb3ee6010649e687341a943666224642bf9c1c6b4f8" +dependencies = [ + "salvo-jwt-auth", + "salvo-proxy", + "salvo-serve-static", + "salvo_core", + "salvo_extra", +] + +[[package]] +name = "salvo-http3" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1436f8bcb7cfb756eb756ae9ac1581c1d80d2814f78f5bbeaae25d2fb24c4f1a" +dependencies = [ + "bytes", + "fastrand", + "futures-util", + "http", + "pin-project-lite", + "quinn", + "quinn-proto", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "salvo-jwt-auth" +version = "0.74.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87d17e823655224cb1fa59928e631a6f153f5d87497cc1d1ca07918c002f63e2" +dependencies = [ + "base64 0.22.1", + "bytes", + "http-body-util", + "hyper-rustls", + "hyper-util", + "jsonwebtoken", + "salvo_core", + "serde", + "serde_json", + "thiserror 2.0.3", + "tokio", + "tracing", +] + +[[package]] +name = "salvo-proxy" +version = "0.74.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "025ed967e89f62b5fb20dd34a9ab1b7e0df68dcb3d922ffabda99f72f44313ed" +dependencies = [ + "fastrand", + "futures-util", + "hyper", + "hyper-rustls", + "hyper-util", + "percent-encoding", + "reqwest", + "salvo_core", + "tokio", + "tracing", +] + +[[package]] +name = "salvo-serde-util" +version = "0.74.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae638180791338bc88727e5201fa8dc791d7eb9a446f0810ad8d0b5c8d65db2e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "salvo-serve-static" +version = "0.74.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40f2e0841aad6860320551e64c32e56922908df095da570f396e8af9539d27ce" +dependencies = [ + "hex", + "mime", + "mime-infer", + "path-slash", + "percent-encoding", + "rust-embed", + "salvo_core", + "serde", + "serde_json", + "time", + "tokio", + "tracing", +] + +[[package]] +name = "salvo_core" +version = "0.74.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaaaa9d122697bb95575402351485b8651c553b91ff8096197811b367a234ba6" +dependencies = [ + "async-trait", + "base64 0.22.1", + "bytes", + "cookie", + "enumflags2", + "eyre", + "form_urlencoded", + "futures-channel", + "futures-util", + "headers", + "http", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "indexmap 2.6.0", + "mime", + "mime-infer", + "multer", + "multimap", + "nix 0.29.0", + "parking_lot", + "percent-encoding", + "pin-project", + "quinn", + "rand 0.8.5", + "regex", + "rustls-pemfile", + "salvo-http3", + "salvo_macros", + "serde", + "serde-xml-rs", + "serde_json", + "sync_wrapper 1.0.1", + "tempfile", + "thiserror 2.0.3", + "tokio", + "tokio-rustls", + "tokio-util", + "tracing", +] + +[[package]] +name = "salvo_extra" +version = "0.74.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da436bf45088d7e77629233905fbac3ff790fbe700eef676a883977219dc97bd" +dependencies = [ + "base64 0.22.1", + "etag", + "futures-util", + "http-body-util", + "hyper", + "pin-project", + "salvo_core", + "serde", + "serde_json", + "tokio", + "tokio-tungstenite", + "tower", + "tracing", + "ulid", +] + +[[package]] +name = "salvo_macros" +version = "0.74.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf066ba183548285f7dc8db26a35767e94ac2fc95f397913c98d5b63b45bed4" +dependencies = [ + "proc-macro-crate 2.0.0", + "proc-macro2", + "quote", + "regex", + "salvo-serde-util", + "syn 2.0.87", +] + [[package]] name = "same-file" version = "1.0.6" @@ -4458,16 +4780,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] - [[package]] name = "security-framework" version = "2.11.1" @@ -4557,6 +4869,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "serde-xml-rs" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb3aa78ecda1ebc9ec9847d5d3aba7d618823446a049ba2491940506da6e2782" +dependencies = [ + "log", + "serde", + "thiserror 1.0.69", + "xml-rs", +] + [[package]] name = "serde_derive" version = "1.0.214" @@ -4580,16 +4904,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_path_to_error" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" -dependencies = [ - "itoa 1.0.11", - "serde", -] - [[package]] name = "serde_qs" version = "0.12.0" @@ -4598,7 +4912,7 @@ checksum = "0431a35568651e363364210c91983c1da5eb29404d9f0928b67d4ebcfa7d330c" dependencies = [ "percent-encoding", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4653,7 +4967,7 @@ dependencies = [ "serde_json", "serde_qs", "server_fn_macro_default", - "thiserror", + "thiserror 1.0.69", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -4758,6 +5072,18 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +[[package]] +name = "simple_asn1" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" +dependencies = [ + "num-bigint", + "num-traits", + "thiserror 1.0.69", + "time", +] + [[package]] name = "siphasher" version = "0.3.11" @@ -4821,7 +5147,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "debdd4b83524961983cea3c55383b3910fd2f24fd13a188f5b091d2d504a61ae" dependencies = [ - "rustc-hash", + "rustc-hash 1.1.0", ] [[package]] @@ -4876,12 +5202,6 @@ dependencies = [ "system-deps", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -4900,6 +5220,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "str-buf" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ceb97b7225c713c2fd4db0153cb6b3cab244eb37900c3f634ed4d43310d8c34" + [[package]] name = "string_cache" version = "0.8.7" @@ -4980,6 +5306,27 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.6.0", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "system-deps" version = "6.2.2" @@ -5086,7 +5433,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +dependencies = [ + "thiserror-impl 2.0.3", ] [[package]] @@ -5100,6 +5456,17 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "thiserror-impl" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "thread_local" version = "1.1.8" @@ -5196,17 +5563,39 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.16", + "rustls", "rustls-pki-types", "tokio", ] +[[package]] +name = "tokio-tungstenite" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite 0.24.0", +] + [[package]] name = "tokio-util" version = "0.7.12" @@ -5277,21 +5666,6 @@ dependencies = [ "winnow 0.6.20", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "tower" version = "0.5.1" @@ -5303,30 +5677,6 @@ dependencies = [ "pin-project-lite", "sync_wrapper 0.1.2", "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-http" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8437150ab6bbc8c5f0f519e3d5ed4aa883a83dd4cdd3d1b21f9482936046cb97" -dependencies = [ - "bitflags 2.6.0", - "bytes", - "futures-util", - "http", - "http-body", - "http-body-util", - "http-range-header", - "httpdate", - "mime", - "mime_guess", - "percent-encoding", - "pin-project-lite", - "tokio", "tokio-util", "tower-layer", "tower-service", @@ -5351,7 +5701,6 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -5446,7 +5795,7 @@ dependencies = [ "objc2-foundation", "once_cell", "png", - "thiserror", + "thiserror 1.0.69", "windows-sys 0.59.0", ] @@ -5470,7 +5819,21 @@ dependencies = [ "log", "rand 0.8.5", "sha1", - "thiserror", + "thiserror 1.0.69", + "utf-8", +] + +[[package]] +name = "tungstenite" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" +dependencies = [ + "byteorder", + "bytes", + "log", + "rand 0.8.5", + "thiserror 1.0.69", "utf-8", ] @@ -5491,6 +5854,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "ulid" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f903f293d11f31c0c29e4148f6dc0d033a7f80cebc0282bea147611667d289" +dependencies = [ + "getrandom 0.2.15", + "rand 0.8.5", + "web-time", +] + [[package]] name = "unicase" version = "2.8.0" @@ -5516,10 +5890,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] -name = "untrusted" -version = "0.7.1" +name = "universal-hash" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] [[package]] name = "untrusted" @@ -5575,6 +5953,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version-compare" version = "0.2.0" @@ -5730,6 +6114,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "webbrowser" version = "0.8.15" @@ -5822,7 +6216,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3a3e2eeb58f82361c93f9777014668eb3d07e7d174ee4c819575a9208011886" dependencies = [ - "thiserror", + "thiserror 1.0.69", "windows", "windows-core", ] @@ -6228,7 +6622,7 @@ dependencies = [ "sha2", "soup3", "tao-macros", - "thiserror", + "thiserror 1.0.69", "webkit2gtk", "webkit2gtk-sys", "webview2-com", @@ -6238,43 +6632,6 @@ dependencies = [ "x11-dl", ] -[[package]] -name = "wtransport" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3715af45f0227dc92d6ce409126450c09f4aec305b899c9bdc9b0aefb4da538" -dependencies = [ - "bytes", - "pem", - "quinn", - "rcgen", - "rustls 0.21.12", - "rustls-native-certs 0.7.3", - "rustls-pemfile 2.2.0", - "rustls-pki-types", - "sha2", - "socket2", - "thiserror", - "time", - "tokio", - "tracing", - "url", - "wtransport-proto", - "x509-parser", -] - -[[package]] -name = "wtransport-proto" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc3b7ced4e99f0ccdaeaa8d51b3ee844fd1b77f9104cf1a46e7afc6e996fd4" -dependencies = [ - "httlib-huffman", - "octets", - "thiserror", - "url", -] - [[package]] name = "x11" version = "2.21.0" @@ -6296,23 +6653,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "x509-parser" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" -dependencies = [ - "asn1-rs", - "data-encoding", - "der-parser", - "lazy_static", - "nom", - "oid-registry", - "rusticata-macros", - "thiserror", - "time", -] - [[package]] name = "xdg-home" version = "1.3.0" @@ -6323,21 +6663,18 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "xml-rs" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af310deaae937e48a26602b730250b4949e125f468f11e6990be3e5304ddd96f" + [[package]] name = "xxhash-rust" version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a5cbf750400958819fb6178eaa83bee5cd9c29a26a40cc241df8c70fdd46984" -[[package]] -name = "yasna" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" -dependencies = [ - "time", -] - [[package]] name = "yoke" version = "0.7.4" @@ -6379,7 +6716,7 @@ dependencies = [ "futures-sink", "futures-util", "hex", - "nix", + "nix 0.27.1", "ordered-stream", "rand 0.8.5", "serde", diff --git a/README.md b/README.md index 20ade65..29a383f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # GUI Development ## Running Desktop -1. `dx build -p mumble-web2-gui --platform desktop` +1. `cargo install dioxus-cli --version 0.6.0-alpha.4` +2. `dx build -p mumble-web2-gui --platform desktop` ## Running Web 1. `cargo install dioxus-cli --version 0.6.0-alpha.4` diff --git a/gui/Dioxus.toml b/gui/Dioxus.toml index f94be0f..b4e1acb 100644 --- a/gui/Dioxus.toml +++ b/gui/Dioxus.toml @@ -10,13 +10,14 @@ asset_dir = "public" [web.app] # HTML title tag content -title = "mumble-web" +title = "Mumble Web 2" +base_path = "gui" [web.watcher] # when watcher trigger, regenerate the `index.html` reload_html = true # which files or dirs will be watcher monitoring -watch_path = ["src", "public"] +watch_path = ["src", "assets"] # include `assets` in web platform [web.resource] diff --git a/gui/src/imp/web.rs b/gui/src/imp/web.rs index f4d3266..79752b2 100644 --- a/gui/src/imp/web.rs +++ b/gui/src/imp/web.rs @@ -351,7 +351,7 @@ pub async fn network_connect( debug!("created option object: {:?}", &object); let mut options = WebTransportOptions::new(); - options.server_certificate_hashes(&array); + options.set_server_certificate_hashes(&array); debug!("created WebTransportOptions"); @@ -359,8 +359,11 @@ pub async fn network_connect( debug!("created WebTransport connection object"); console::log_1(&transport.clone().into()); - if let Err(e) = wasm_bindgen_futures::JsFuture::from(transport.ready()).await { - bail!("could not connect to transport: {e:?}"); + if let Err(e) = wasm_bindgen_futures::JsFuture::from(transport.ready()) + .await + .ey() + { + bail!("could not connect to transport: {e}"); } info!("transport is ready"); diff --git a/proxy/Cargo.toml b/proxy/Cargo.toml index 39116d6..048c5b5 100644 --- a/proxy/Cargo.toml +++ b/proxy/Cargo.toml @@ -5,18 +5,14 @@ edition = "2021" [dependencies] color-eyre = "0.6.3" -axum = "0.7.7" -axum-server = { version = "0.7.1", features = ["tls-rustls"] } -lazy_static = "1.4.0" -rustls-pemfile = "2.2.0" serde = { version = "1.0.214", features = ["derive"] } serde_json = "1.0.132" tokio = { version = "1.37.0", features = ["full"] } -tokio-rustls = "0.26.0" +tokio-rustls = "^0.26" toml = "0.8.19" -tower = "0.5.1" -tower-http = { version = "0.6.1", features = ["fs"] } tracing = { version = "0.1.40", features = ["async-await"] } tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } -wtransport = "0.1.13" mumble-web2-common = { workspace = true } +salvo = { version = "0.74.2", features = ["quinn", "eyre", "rustls", "serve-static", "logging"] } +once_cell = "1.20.2" +rustls = { version = "^0.23", features = ["aws_lc_rs"] } diff --git a/proxy/config.toml.example b/proxy/config.toml.example index a21f270..c2d641a 100644 --- a/proxy/config.toml.example +++ b/proxy/config.toml.example @@ -1,12 +1,11 @@ -proxy_listen_address = "127.0.0.1:4433" -http_listen_address = "127.0.0.1:4434" +https_listen_address = "127.0.0.1:4433" +http_listen_address = "127.0.0.1:8080" cert_path = "./cert.pem" key_path = "./key.pem" mumble_server_url = "voip.ohea.xyz:64738" -gui_path = "../gui/dist" -serve_https = false +gui_path = "../target/dx/mumble-web2-gui/debug/web/public" [gui] force_proxy = true -proxy_url = "https://localhost:4433" +proxy_url = "https://localhost:4433/proxy" # cert_hash = [...] diff --git a/proxy/src/main.rs b/proxy/src/main.rs index dc90b3e..5b0a074 100644 --- a/proxy/src/main.rs +++ b/proxy/src/main.rs @@ -1,14 +1,15 @@ -use axum::extract::State; -use axum::http::{Response, StatusCode}; -use axum::response::IntoResponse; use color_eyre::eyre::{anyhow, Context, Error, Result}; use mumble_web2_common::GuiConfig; +use once_cell::sync::OnceCell; +use salvo::conn::rustls::{Keycert, RustlsConfig}; +use salvo::logging::Logger; +use salvo::prelude::*; +use salvo::proto::quic::BidiStream; use serde::Deserialize; -use std::future::IntoFuture; use std::net::{SocketAddr, ToSocketAddrs}; use std::path::PathBuf; -use std::time::Duration; -use tokio::fs::read_to_string; +use std::sync::Arc; +use tokio::fs; use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt}; use tokio::net::TcpStream; use tokio::pin; @@ -16,25 +17,229 @@ use tokio_rustls::rustls::client::danger::{HandshakeSignatureValid, ServerCertVe use tokio_rustls::rustls::pki_types::{CertificateDer, ServerName, UnixTime}; use tokio_rustls::rustls::{ClientConfig, DigitallySignedStruct}; use tokio_rustls::{rustls, TlsConnector}; -use tracing::error; use tracing::info; use tracing::info_span; use tracing::Instrument; +use tracing::{error, instrument}; use tracing_subscriber::filter::LevelFilter; use tracing_subscriber::EnvFilter; -use wtransport::endpoint::IncomingSession; -use wtransport::Endpoint; -use wtransport::Identity; -use wtransport::ServerConfig; -use lazy_static::lazy_static; -use std::collections::HashMap; -use std::sync::{Arc, Mutex}; +#[derive(Clone, Deserialize)] +struct Config { + https_listen_address: SocketAddr, + http_listen_address: Option, + cert_path: PathBuf, + key_path: PathBuf, + mumble_server_url: String, + mumble_server_address: Option, + gui_path: PathBuf, + gui: GuiConfig, +} -type GlobalMap = Mutex>; +static CONFIG: OnceCell = OnceCell::new(); -lazy_static! { - static ref DATA_MAP: GlobalMap = Mutex::new(HashMap::new()); +#[handler] +#[instrument] +async fn serve_gui_index_html(req: &Request, res: &mut Response) { + let config = CONFIG.get().unwrap(); + + // Load the HTML file + let path = config.gui_path.join("index.html"); + let html = match fs::read_to_string(&path).await { + Ok(content) => content, + Err(err) => { + error!("could not load {}: {:?}", path.display(), err); + res.status_code(StatusCode::INTERNAL_SERVER_ERROR); + return; + } + }; + + // Insert the script tag with configuration + let modified_html = html.replace( + "", + &format!( + "\n", + serde_json::to_string(&config.gui).unwrap(), + ), + ); + res.render(Text::Html(modified_html)); +} + +#[handler] +async fn redirect_to_gui(res: &mut Response) { + res.render(Redirect::permanent("/gui")); +} + +async fn init_config() -> Result<()> { + let mut config: Config = toml::from_str( + &fs::read_to_string("./config.toml") + .await + .context("reading config.toml (try making a copy of config.toml.example)")?, + )?; + let mumble_server_addr = config + .mumble_server_url + .to_socket_addrs() + .context(format!( + "parsing mumble_server_url={}", + config.mumble_server_url + ))? + .next() + .ok_or(anyhow!( + "no socket addrs in mumble_server_url={}", + config.mumble_server_url + ))?; + config.mumble_server_address = Some(mumble_server_addr); + CONFIG + .set(config) + .map_err(|_| anyhow!("config already initialized"))?; + Ok(()) +} + +#[tokio::main] +async fn main() -> Result<()> { + init_logging(); + init_config().await?; + let config = CONFIG.get().unwrap(); + + // Server routing + let router = Router::new() + .get(redirect_to_gui) + .push(Router::with_path("/proxy").goal(connect_proxy)) + .push(Router::with_path("/gui").get(serve_gui_index_html)) + .push(Router::with_path("/gui/<*+rest>").get(StaticDir::new(config.gui_path.clone()))) + .hoop(Logger::new()); + + // Read server certs + rustls::crypto::aws_lc_rs::default_provider() + .install_default() + .map_err(|e| anyhow!("could not install crypto provider {e:?}"))?; + let cert = fs::read(&config.cert_path) + .await + .context(format!("reading cert {}", config.cert_path.display()))?; + let key = fs::read(&config.key_path) + .await + .context(format!("reading key {}", config.key_path.display()))?; + let rustls_config = RustlsConfig::new(Keycert::new().cert(cert.as_slice()).key(key.as_slice())); + + // Create http listeners + let http_listener = config.http_listen_address.map(TcpListener::new); + let https_listener = + TcpListener::new(config.https_listen_address).rustls(rustls_config.clone()); + let http3_listener = QuinnListener::new(rustls_config, config.https_listen_address); + + // Start server + match (http_listener, https_listener, http3_listener) { + (Some(a), b, c) => { + let accepter = a.join(b).join(c).bind().await; + Server::new(accepter).serve(router).await; + } + (None, b, c) => { + let accepter = b.join(c).bind().await; + Server::new(accepter).serve(router).await; + } + } + + Ok(()) +} + +#[handler] +#[instrument] +async fn connect_proxy(req: &mut Request, res: &mut Response) { + info!("received proxy request"); + let mumble_server_address = CONFIG.get().unwrap().mumble_server_address.unwrap(); + + let wt = match req.web_transport_mut().await { + Ok(wt) => wt, + Err(err) => { + res.status_code(StatusCode::BAD_REQUEST); + res.render(format!("error with webtransport: {err:?}")); + return; + } + }; + info!("got webtransport for connection"); + + use salvo::webtransport::server::AcceptedBi; + let (id, bi) = match wt.accept_bi().await { + Ok(Some(AcceptedBi::BidiStream(id, bi))) => (id, bi), + Ok(Some(AcceptedBi::Request(req, _))) => { + res.status_code(StatusCode::BAD_REQUEST); + res.render(format!( + "expected webtransport stream but got request {req:?}" + )); + return; + } + Ok(None) => { + res.status_code(StatusCode::BAD_REQUEST); + res.render(format!("no bidirectional connection requested")); + return; + } + Err(err) => { + res.status_code(StatusCode::INTERNAL_SERVER_ERROR); + res.render(format!("error with bidirectional connection: {err:?}")); + return; + } + }; + + /* + let id = wt.session_id(); + let bi = match wt.open_bi(id).await { + Ok(bi) => bi, + Err(err) => { + res.status_code(StatusCode::BAD_REQUEST); + res.render(format!("could not open bidirectional stream: {err:?}")); + return; + } + }; + */ + + let (outgoing, incoming) = bi.split(); + tokio::spawn(async move { + if let Err(error) = connect_proxy_impl(mumble_server_address, incoming, outgoing).await { + error!("error connecting proxy {error:?}") + } + }); + + res.render("connected"); +} + +#[instrument(skip(incoming, outgoing))] +async fn connect_proxy_impl( + mumble_server_address: SocketAddr, + incoming: impl AsyncRead + Send + Sync + 'static, + outgoing: impl AsyncWrite + Send + Sync + 'static, +) -> Result<()> { + info!("connecting to Mumble server..."); + + let config = ClientConfig::builder() + .dangerous() + .with_custom_certificate_verifier(Arc::new(NoCertificateVerification)) + .with_no_client_auth(); + + let connector = TlsConnector::from(Arc::new(config)); + + let server_tcp = TcpStream::connect(mumble_server_address).await?; + let server_stream = connector + .connect("example.com".try_into()?, server_tcp) + .await?; + let (read_server, write_server) = tokio::io::split(server_stream); + + info!("connected to Mumble server"); + + // Spawn tasks to handle transmitting data between the WebTransport client and Mumble TCP Server + let c2s = tokio::spawn( + pass_bytes_loop(incoming, write_server) + .instrument(info_span!("Handler", "Client to server")), + ); + let s2c = tokio::spawn( + pass_bytes_loop(read_server, outgoing) + .instrument(info_span!("Handler", "Server to client")), + ); + + tokio::select! { + res = c2s => res??, + res = s2c => res??, + }; + Ok(()) } #[derive(Debug)] @@ -89,261 +294,27 @@ impl ServerCertVerifier for NoCertificateVerification { } } -#[derive(Clone, Deserialize)] -struct Config { - proxy_listen_address: SocketAddr, - http_listen_address: SocketAddr, - cert_path: PathBuf, - key_path: PathBuf, - #[serde(default)] - serve_https: bool, - mumble_server_url: String, - gui_path: PathBuf, - gui: GuiConfig, -} - -//async fn serve_index_html_with_config(State(config): State) -> impl IntoResponse { -async fn serve_index_html_with_config(State(config): State) -> impl IntoResponse { - // Load the HTML file - let html = match read_to_string(config.gui_path.join("index.html")).await { - Ok(content) => content, - Err(_) => return (StatusCode::NOT_FOUND, "File not found").into_response(), - }; - - // Insert the script tag with configuration - let modified_html = html.replace( - "", - &format!( - "\n", - serde_json::to_string(&config.gui).unwrap(), - ), - ); - - // Create a response with the modified HTML - Response::builder() - .status(StatusCode::OK) - .header("Content-Type", "text/html") - .body(modified_html) - .unwrap() - .into_response() -} - -fn configure_tls(config: &Config) -> Result { - // Thanks perplexity! - use rustls_pemfile::{certs, pkcs8_private_keys}; - use std::fs::File; - use std::io::BufReader; - - // Create a new ServerConfig with no client authentication - //(rustls::server::NoClientAuth::new()); - - // Read the certificate file - let cert_file = File::open(&config.cert_path) - .context(format!("opening cert {}", config.cert_path.display()))?; - let mut cert_reader = BufReader::new(cert_file); - let cert_chain = certs(&mut cert_reader).collect::>()?; - - // Read the private key file - let key_file = File::open(&config.key_path) - .context(format!("opening key {}", config.key_path.display()))?; - let mut key_reader = BufReader::new(key_file); - let key = pkcs8_private_keys(&mut key_reader) - .next() - .ok_or(anyhow!("no keys in key.pem"))??; - - // Set the certificate chain and private key - let config = rustls::ServerConfig::builder() - .with_no_client_auth() - .with_single_cert(cert_chain, key.into())?; - - Ok(config) -} - -#[tokio::main] -async fn main() -> Result<()> { - init_logging(); - - let proxy_config: Config = toml::from_str( - &read_to_string("./config.toml") - .await - .context("reading config.toml (try making a copy of config.toml.example)")?, - )?; - - let mumble_server_addr = proxy_config - .mumble_server_url - .to_socket_addrs() - .context(format!( - "parsing mumble_server_url={}", - proxy_config.mumble_server_url - ))? - .next() - .ok_or(anyhow!( - "no socket addrs in mumble_server_url={}", - proxy_config.mumble_server_url - ))?; - - // Setup HTTP Server - //let http = axum::Router::new().route("/", axum::routing::get(serve_gui)); - let app = axum::Router::new() - .route("/", axum::routing::get(serve_index_html_with_config)) - .fallback_service(tower_http::services::ServeDir::new(&proxy_config.gui_path)) - .with_state(proxy_config.clone()); - if proxy_config.serve_https { - tokio::spawn( - axum_server::bind_rustls( - proxy_config.http_listen_address, - axum_server::tls_rustls::RustlsConfig::from_config(Arc::new(configure_tls( - &proxy_config, - )?)), - ) - .serve(app.into_make_service()) - .into_future(), - ); - } else { - tokio::spawn( - axum_server::bind(proxy_config.http_listen_address) - .serve(app.into_make_service()) - .into_future(), - ); - } - - // Setup WebTransport proxy listener - let identity = Identity::load_pemfiles(proxy_config.cert_path, proxy_config.key_path).await?; - let config = ServerConfig::builder() - .with_bind_address(proxy_config.proxy_listen_address) - .with_identity(&identity) - .keep_alive_interval(Some(Duration::from_secs(20))) - .build(); - - let server = Endpoint::server(config)?; - - info!("Server ready!"); - - for id in 0.. { - let incoming_session = server.accept().await; - tokio::spawn( - handle_connection(incoming_session, id, mumble_server_addr) - .instrument(info_span!("Connection", id)), - ); - } - - Ok(()) -} - -async fn handle_connection( - incoming_session: IncomingSession, - id: usize, - mumble_server_address: SocketAddr, -) { - // Wrapper to handle connection establishment failures - if let Err(e) = handle_connection_impl(incoming_session, id, mumble_server_address).await { - error!("{:?}", e); - } -} - -async fn handle_connection_impl( - incoming_session: IncomingSession, - id: usize, - mumble_server_address: SocketAddr, -) -> Result<()> { - info!("Waiting for session request..."); - - let session_request = incoming_session.await?; - - info!( - "New session: Authority: '{}', Path: '{}'", - session_request.authority(), - session_request.path() - ); - - let connection = session_request.accept().await?; - let stream = connection.accept_bi().await?; - - info!("Connecting to corresponding Mumble server..."); - - let config = ClientConfig::builder() - .dangerous() - .with_custom_certificate_verifier(Arc::new(NoCertificateVerification)) - .with_no_client_auth(); - - let connector = TlsConnector::from(Arc::new(config)); - - let server_tcp = TcpStream::connect(mumble_server_address).await?; - let server_stream = connector - .connect("example.com".try_into()?, server_tcp) - .await?; - let (read_server, write_server) = tokio::io::split(server_stream); - - info!("Connected to Mumble Server!"); - - // Store connection in global map to prevent it getting dropped - DATA_MAP.lock().unwrap().insert(id, connection); - - info!("Spawing jobs..."); - // Spawn tasks to handle transmitting data between the WebTransport client and Mumble TCP Server - tokio::spawn( - handle_client_to_server(stream.1, write_server) - .instrument(info_span!("Handler", "Client to server")), - ); - tokio::spawn( - handle_server_to_client(stream.0, read_server) - .instrument(info_span!("Handler", "Server to client")), - ); - - info!("Spawned jobs."); - - Ok(()) -} - -async fn handle_client_to_server( - client_stream: wtransport::RecvStream, - server_stream: impl AsyncWrite, -) { - let result = client_to_server_loop(client_stream, server_stream).await; - error!("{:?}", result); -} - -async fn client_to_server_loop( - mut client_stream: wtransport::RecvStream, - server_stream: impl AsyncWrite, +async fn pass_bytes_loop( + client_stream: impl AsyncRead + Sync + Send + 'static, + server_stream: impl AsyncWrite + Send + Sync + 'static, ) -> Result<()> { let mut buffer = vec![0; 65536].into_boxed_slice(); + pin!(client_stream); pin!(server_stream); loop { - let bytes_read = match client_stream.read(&mut buffer).await? { - Some(bytes_read) => bytes_read, - None => break Ok(()), - }; + let bytes_read = client_stream.read(&mut buffer).await?; + if bytes_read == 0 { + break Ok(()); + } server_stream.write_all(&buffer[..bytes_read]).await?; server_stream.flush().await?; } } -async fn handle_server_to_client( - client_stream: wtransport::SendStream, - server_stream: impl AsyncRead, -) { - let result = server_to_client_loop(client_stream, server_stream).await; - error!("{:?}", result); -} - -async fn server_to_client_loop( - mut client_stream: wtransport::SendStream, - server_stream: impl AsyncRead, -) -> Result<()> { - let mut buffer = vec![0; 65536].into_boxed_slice(); - pin!(server_stream); - loop { - let bytes_read = server_stream.read(&mut buffer).await?; - - client_stream.write_all(&buffer[..bytes_read]).await?; - } -} - fn init_logging() { let env_filter = EnvFilter::builder() - .with_default_directive(LevelFilter::INFO.into()) + .with_default_directive(LevelFilter::DEBUG.into()) .from_env_lossy(); tracing_subscriber::fmt()