diff options
| -rw-r--r-- | Cargo.lock | 648 | ||||
| -rw-r--r-- | Cargo.toml | 9 | ||||
| -rw-r--r-- | src/http/landing.rs | 35 | ||||
| -rw-r--r-- | src/http/mod.rs | 142 | ||||
| -rw-r--r-- | src/http/websocket.rs | 73 |
5 files changed, 226 insertions, 681 deletions
| @@ -3,209 +3,6 @@ | |||
| 3 | version = 3 | 3 | version = 3 |
| 4 | 4 | ||
| 5 | [[package]] | 5 | [[package]] |
| 6 | name = "actix-codec" | ||
| 7 | version = "0.5.2" | ||
| 8 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 9 | checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a" | ||
| 10 | dependencies = [ | ||
| 11 | "bitflags", | ||
| 12 | "bytes", | ||
| 13 | "futures-core", | ||
| 14 | "futures-sink", | ||
| 15 | "memchr", | ||
| 16 | "pin-project-lite", | ||
| 17 | "tokio", | ||
| 18 | "tokio-util", | ||
| 19 | "tracing", | ||
| 20 | ] | ||
| 21 | |||
| 22 | [[package]] | ||
| 23 | name = "actix-http" | ||
| 24 | version = "3.11.2" | ||
| 25 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 26 | checksum = "7926860314cbe2fb5d1f13731e387ab43bd32bca224e82e6e2db85de0a3dba49" | ||
| 27 | dependencies = [ | ||
| 28 | "actix-codec", | ||
| 29 | "actix-rt", | ||
| 30 | "actix-service", | ||
| 31 | "actix-utils", | ||
| 32 | "base64", | ||
| 33 | "bitflags", | ||
| 34 | "brotli", | ||
| 35 | "bytes", | ||
| 36 | "bytestring", | ||
| 37 | "derive_more", | ||
| 38 | "encoding_rs", | ||
| 39 | "flate2", | ||
| 40 | "foldhash", | ||
| 41 | "futures-core", | ||
| 42 | "h2", | ||
| 43 | "http 0.2.12", | ||
| 44 | "httparse", | ||
| 45 | "httpdate", | ||
| 46 | "itoa", | ||
| 47 | "language-tags", | ||
| 48 | "local-channel", | ||
| 49 | "mime", | ||
| 50 | "percent-encoding", | ||
| 51 | "pin-project-lite", | ||
| 52 | "rand 0.9.2", | ||
| 53 | "sha1", | ||
| 54 | "smallvec", | ||
| 55 | "tokio", | ||
| 56 | "tokio-util", | ||
| 57 | "tracing", | ||
| 58 | "zstd", | ||
| 59 | ] | ||
| 60 | |||
| 61 | [[package]] | ||
| 62 | name = "actix-macros" | ||
| 63 | version = "0.2.4" | ||
| 64 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 65 | checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" | ||
| 66 | dependencies = [ | ||
| 67 | "quote", | ||
| 68 | "syn", | ||
| 69 | ] | ||
| 70 | |||
| 71 | [[package]] | ||
| 72 | name = "actix-router" | ||
| 73 | version = "0.5.3" | ||
| 74 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 75 | checksum = "13d324164c51f63867b57e73ba5936ea151b8a41a1d23d1031eeb9f70d0236f8" | ||
| 76 | dependencies = [ | ||
| 77 | "bytestring", | ||
| 78 | "cfg-if", | ||
| 79 | "http 0.2.12", | ||
| 80 | "regex", | ||
| 81 | "regex-lite", | ||
| 82 | "serde", | ||
| 83 | "tracing", | ||
| 84 | ] | ||
| 85 | |||
| 86 | [[package]] | ||
| 87 | name = "actix-rt" | ||
| 88 | version = "2.11.0" | ||
| 89 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 90 | checksum = "92589714878ca59a7626ea19734f0e07a6a875197eec751bb5d3f99e64998c63" | ||
| 91 | dependencies = [ | ||
| 92 | "futures-core", | ||
| 93 | "tokio", | ||
| 94 | ] | ||
| 95 | |||
| 96 | [[package]] | ||
| 97 | name = "actix-server" | ||
| 98 | version = "2.6.0" | ||
| 99 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 100 | checksum = "a65064ea4a457eaf07f2fba30b4c695bf43b721790e9530d26cb6f9019ff7502" | ||
| 101 | dependencies = [ | ||
| 102 | "actix-rt", | ||
| 103 | "actix-service", | ||
| 104 | "actix-utils", | ||
| 105 | "futures-core", | ||
| 106 | "futures-util", | ||
| 107 | "mio", | ||
| 108 | "socket2 0.5.10", | ||
| 109 | "tokio", | ||
| 110 | "tracing", | ||
| 111 | ] | ||
| 112 | |||
| 113 | [[package]] | ||
| 114 | name = "actix-service" | ||
| 115 | version = "2.0.3" | ||
| 116 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 117 | checksum = "9e46f36bf0e5af44bdc4bdb36fbbd421aa98c79a9bce724e1edeb3894e10dc7f" | ||
| 118 | dependencies = [ | ||
| 119 | "futures-core", | ||
| 120 | "pin-project-lite", | ||
| 121 | ] | ||
| 122 | |||
| 123 | [[package]] | ||
| 124 | name = "actix-utils" | ||
| 125 | version = "3.0.1" | ||
| 126 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 127 | checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" | ||
| 128 | dependencies = [ | ||
| 129 | "local-waker", | ||
| 130 | "pin-project-lite", | ||
| 131 | ] | ||
| 132 | |||
| 133 | [[package]] | ||
| 134 | name = "actix-web" | ||
| 135 | version = "4.12.0" | ||
| 136 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 137 | checksum = "2233f53f6cb18ae038ce1f0713ca0c72ca0c4b71fe9aaeb59924ce2c89c6dd85" | ||
| 138 | dependencies = [ | ||
| 139 | "actix-codec", | ||
| 140 | "actix-http", | ||
| 141 | "actix-macros", | ||
| 142 | "actix-router", | ||
| 143 | "actix-rt", | ||
| 144 | "actix-server", | ||
| 145 | "actix-service", | ||
| 146 | "actix-utils", | ||
| 147 | "actix-web-codegen", | ||
| 148 | "bytes", | ||
| 149 | "bytestring", | ||
| 150 | "cfg-if", | ||
| 151 | "cookie", | ||
| 152 | "derive_more", | ||
| 153 | "encoding_rs", | ||
| 154 | "foldhash", | ||
| 155 | "futures-core", | ||
| 156 | "futures-util", | ||
| 157 | "impl-more", | ||
| 158 | "itoa", | ||
| 159 | "language-tags", | ||
| 160 | "log", | ||
| 161 | "mime", | ||
| 162 | "once_cell", | ||
| 163 | "pin-project-lite", | ||
| 164 | "regex", | ||
| 165 | "regex-lite", | ||
| 166 | "serde", | ||
| 167 | "serde_json", | ||
| 168 | "serde_urlencoded", | ||
| 169 | "smallvec", | ||
| 170 | "socket2 0.6.1", | ||
| 171 | "time", | ||
| 172 | "tracing", | ||
| 173 | "url", | ||
| 174 | ] | ||
| 175 | |||
| 176 | [[package]] | ||
| 177 | name = "actix-web-codegen" | ||
| 178 | version = "4.3.0" | ||
| 179 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 180 | checksum = "f591380e2e68490b5dfaf1dd1aa0ebe78d84ba7067078512b4ea6e4492d622b8" | ||
| 181 | dependencies = [ | ||
| 182 | "actix-router", | ||
| 183 | "proc-macro2", | ||
| 184 | "quote", | ||
| 185 | "syn", | ||
| 186 | ] | ||
| 187 | |||
| 188 | [[package]] | ||
| 189 | name = "actix-ws" | ||
| 190 | version = "0.3.0" | ||
| 191 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 192 | checksum = "a3a1fb4f9f2794b0aadaf2ba5f14a6f034c7e86957b458c506a8cb75953f2d99" | ||
| 193 | dependencies = [ | ||
| 194 | "actix-codec", | ||
| 195 | "actix-http", | ||
| 196 | "actix-web", | ||
| 197 | "bytestring", | ||
| 198 | "futures-core", | ||
| 199 | "tokio", | ||
| 200 | ] | ||
| 201 | |||
| 202 | [[package]] | ||
| 203 | name = "adler2" | ||
| 204 | version = "2.0.1" | ||
| 205 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 206 | checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" | ||
| 207 | |||
| 208 | [[package]] | ||
| 209 | name = "aead" | 6 | name = "aead" |
| 210 | version = "0.5.2" | 7 | version = "0.5.2" |
| 211 | source = "registry+https://github.com/rust-lang/crates.io-index" | 8 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -225,21 +22,6 @@ dependencies = [ | |||
| 225 | ] | 22 | ] |
| 226 | 23 | ||
| 227 | [[package]] | 24 | [[package]] |
| 228 | name = "alloc-no-stdlib" | ||
| 229 | version = "2.0.4" | ||
| 230 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 231 | checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" | ||
| 232 | |||
| 233 | [[package]] | ||
| 234 | name = "alloc-stdlib" | ||
| 235 | version = "0.2.2" | ||
| 236 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 237 | checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" | ||
| 238 | dependencies = [ | ||
| 239 | "alloc-no-stdlib", | ||
| 240 | ] | ||
| 241 | |||
| 242 | [[package]] | ||
| 243 | name = "android_system_properties" | 25 | name = "android_system_properties" |
| 244 | version = "0.1.5" | 26 | version = "0.1.5" |
| 245 | source = "registry+https://github.com/rust-lang/crates.io-index" | 27 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -357,7 +139,7 @@ dependencies = [ | |||
| 357 | "tokio", | 139 | "tokio", |
| 358 | "tokio-rustls", | 140 | "tokio-rustls", |
| 359 | "tokio-socks", | 141 | "tokio-socks", |
| 360 | "tokio-tungstenite 0.26.2", | 142 | "tokio-tungstenite", |
| 361 | "url", | 143 | "url", |
| 362 | "wasm-bindgen", | 144 | "wasm-bindgen", |
| 363 | "web-sys", | 145 | "web-sys", |
| @@ -370,6 +152,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 370 | checksum = "ef49f5882e4b6afaac09ad239a4f8c70a24b8f2b0897edb1f706008efd109cf4" | 152 | checksum = "ef49f5882e4b6afaac09ad239a4f8c70a24b8f2b0897edb1f706008efd109cf4" |
| 371 | 153 | ||
| 372 | [[package]] | 154 | [[package]] |
| 155 | name = "atomic-waker" | ||
| 156 | version = "1.1.2" | ||
| 157 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 158 | checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" | ||
| 159 | |||
| 160 | [[package]] | ||
| 373 | name = "autocfg" | 161 | name = "autocfg" |
| 374 | version = "1.5.0" | 162 | version = "1.5.0" |
| 375 | source = "registry+https://github.com/rust-lang/crates.io-index" | 163 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -462,27 +250,6 @@ dependencies = [ | |||
| 462 | ] | 250 | ] |
| 463 | 251 | ||
| 464 | [[package]] | 252 | [[package]] |
| 465 | name = "brotli" | ||
| 466 | version = "8.0.2" | ||
| 467 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 468 | checksum = "4bd8b9603c7aa97359dbd97ecf258968c95f3adddd6db2f7e7a5bef101c84560" | ||
| 469 | dependencies = [ | ||
| 470 | "alloc-no-stdlib", | ||
| 471 | "alloc-stdlib", | ||
| 472 | "brotli-decompressor", | ||
| 473 | ] | ||
| 474 | |||
| 475 | [[package]] | ||
| 476 | name = "brotli-decompressor" | ||
| 477 | version = "5.0.0" | ||
| 478 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 479 | checksum = "874bb8112abecc98cbd6d81ea4fa7e94fb9449648c93cc89aa40c81c24d7de03" | ||
| 480 | dependencies = [ | ||
| 481 | "alloc-no-stdlib", | ||
| 482 | "alloc-stdlib", | ||
| 483 | ] | ||
| 484 | |||
| 485 | [[package]] | ||
| 486 | name = "bumpalo" | 253 | name = "bumpalo" |
| 487 | version = "3.19.0" | 254 | version = "3.19.0" |
| 488 | source = "registry+https://github.com/rust-lang/crates.io-index" | 255 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -495,15 +262,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 495 | checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" | 262 | checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" |
| 496 | 263 | ||
| 497 | [[package]] | 264 | [[package]] |
| 498 | name = "bytestring" | ||
| 499 | version = "1.5.0" | ||
| 500 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 501 | checksum = "113b4343b5f6617e7ad401ced8de3cc8b012e73a594347c307b90db3e9271289" | ||
| 502 | dependencies = [ | ||
| 503 | "bytes", | ||
| 504 | ] | ||
| 505 | |||
| 506 | [[package]] | ||
| 507 | name = "cbc" | 265 | name = "cbc" |
| 508 | version = "0.1.2" | 266 | version = "0.1.2" |
| 509 | source = "registry+https://github.com/rust-lang/crates.io-index" | 267 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -519,8 +277,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 519 | checksum = "37521ac7aabe3d13122dc382493e20c9416f299d2ccd5b3a5340a2570cdeb0f3" | 277 | checksum = "37521ac7aabe3d13122dc382493e20c9416f299d2ccd5b3a5340a2570cdeb0f3" |
| 520 | dependencies = [ | 278 | dependencies = [ |
| 521 | "find-msvc-tools", | 279 | "find-msvc-tools", |
| 522 | "jobserver", | ||
| 523 | "libc", | ||
| 524 | "shlex", | 280 | "shlex", |
| 525 | ] | 281 | ] |
| 526 | 282 | ||
| @@ -625,17 +381,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 625 | checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" | 381 | checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" |
| 626 | 382 | ||
| 627 | [[package]] | 383 | [[package]] |
| 628 | name = "cookie" | ||
| 629 | version = "0.16.2" | ||
| 630 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 631 | checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" | ||
| 632 | dependencies = [ | ||
| 633 | "percent-encoding", | ||
| 634 | "time", | ||
| 635 | "version_check", | ||
| 636 | ] | ||
| 637 | |||
| 638 | [[package]] | ||
| 639 | name = "core-foundation-sys" | 384 | name = "core-foundation-sys" |
| 640 | version = "0.8.7" | 385 | version = "0.8.7" |
| 641 | source = "registry+https://github.com/rust-lang/crates.io-index" | 386 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -651,15 +396,6 @@ dependencies = [ | |||
| 651 | ] | 396 | ] |
| 652 | 397 | ||
| 653 | [[package]] | 398 | [[package]] |
| 654 | name = "crc32fast" | ||
| 655 | version = "1.5.0" | ||
| 656 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 657 | checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" | ||
| 658 | dependencies = [ | ||
| 659 | "cfg-if", | ||
| 660 | ] | ||
| 661 | |||
| 662 | [[package]] | ||
| 663 | name = "crypto-common" | 399 | name = "crypto-common" |
| 664 | version = "0.1.6" | 400 | version = "0.1.6" |
| 665 | source = "registry+https://github.com/rust-lang/crates.io-index" | 401 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -677,36 +413,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 677 | checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" | 413 | checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" |
| 678 | 414 | ||
| 679 | [[package]] | 415 | [[package]] |
| 680 | name = "deranged" | ||
| 681 | version = "0.5.5" | ||
| 682 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 683 | checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" | ||
| 684 | dependencies = [ | ||
| 685 | "powerfmt", | ||
| 686 | ] | ||
| 687 | |||
| 688 | [[package]] | ||
| 689 | name = "derive_more" | ||
| 690 | version = "2.0.1" | ||
| 691 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 692 | checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" | ||
| 693 | dependencies = [ | ||
| 694 | "derive_more-impl", | ||
| 695 | ] | ||
| 696 | |||
| 697 | [[package]] | ||
| 698 | name = "derive_more-impl" | ||
| 699 | version = "2.0.1" | ||
| 700 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 701 | checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" | ||
| 702 | dependencies = [ | ||
| 703 | "proc-macro2", | ||
| 704 | "quote", | ||
| 705 | "syn", | ||
| 706 | "unicode-xid", | ||
| 707 | ] | ||
| 708 | |||
| 709 | [[package]] | ||
| 710 | name = "digest" | 416 | name = "digest" |
| 711 | version = "0.10.7" | 417 | version = "0.10.7" |
| 712 | source = "registry+https://github.com/rust-lang/crates.io-index" | 418 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -741,15 +447,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 741 | checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" | 447 | checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" |
| 742 | 448 | ||
| 743 | [[package]] | 449 | [[package]] |
| 744 | name = "encoding_rs" | ||
| 745 | version = "0.8.35" | ||
| 746 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 747 | checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" | ||
| 748 | dependencies = [ | ||
| 749 | "cfg-if", | ||
| 750 | ] | ||
| 751 | |||
| 752 | [[package]] | ||
| 753 | name = "equivalent" | 450 | name = "equivalent" |
| 754 | version = "1.0.2" | 451 | version = "1.0.2" |
| 755 | source = "registry+https://github.com/rust-lang/crates.io-index" | 452 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -762,28 +459,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 762 | checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" | 459 | checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" |
| 763 | 460 | ||
| 764 | [[package]] | 461 | [[package]] |
| 765 | name = "flate2" | ||
| 766 | version = "1.1.5" | ||
| 767 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 768 | checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" | ||
| 769 | dependencies = [ | ||
| 770 | "crc32fast", | ||
| 771 | "miniz_oxide", | ||
| 772 | ] | ||
| 773 | |||
| 774 | [[package]] | ||
| 775 | name = "fnv" | 462 | name = "fnv" |
| 776 | version = "1.0.7" | 463 | version = "1.0.7" |
| 777 | source = "registry+https://github.com/rust-lang/crates.io-index" | 464 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 778 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" | 465 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" |
| 779 | 466 | ||
| 780 | [[package]] | 467 | [[package]] |
| 781 | name = "foldhash" | ||
| 782 | version = "0.1.5" | ||
| 783 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 784 | checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" | ||
| 785 | |||
| 786 | [[package]] | ||
| 787 | name = "form_urlencoded" | 468 | name = "form_urlencoded" |
| 788 | version = "1.2.2" | 469 | version = "1.2.2" |
| 789 | source = "registry+https://github.com/rust-lang/crates.io-index" | 470 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -949,16 +630,16 @@ dependencies = [ | |||
| 949 | 630 | ||
| 950 | [[package]] | 631 | [[package]] |
| 951 | name = "h2" | 632 | name = "h2" |
| 952 | version = "0.3.27" | 633 | version = "0.4.12" |
| 953 | source = "registry+https://github.com/rust-lang/crates.io-index" | 634 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 954 | checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d" | 635 | checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" |
| 955 | dependencies = [ | 636 | dependencies = [ |
| 637 | "atomic-waker", | ||
| 956 | "bytes", | 638 | "bytes", |
| 957 | "fnv", | 639 | "fnv", |
| 958 | "futures-core", | 640 | "futures-core", |
| 959 | "futures-sink", | 641 | "futures-sink", |
| 960 | "futures-util", | 642 | "http", |
| 961 | "http 0.2.12", | ||
| 962 | "indexmap", | 643 | "indexmap", |
| 963 | "slab", | 644 | "slab", |
| 964 | "tokio", | 645 | "tokio", |
| @@ -1010,9 +691,9 @@ dependencies = [ | |||
| 1010 | 691 | ||
| 1011 | [[package]] | 692 | [[package]] |
| 1012 | name = "http" | 693 | name = "http" |
| 1013 | version = "0.2.12" | 694 | version = "1.3.1" |
| 1014 | source = "registry+https://github.com/rust-lang/crates.io-index" | 695 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1015 | checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" | 696 | checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" |
| 1016 | dependencies = [ | 697 | dependencies = [ |
| 1017 | "bytes", | 698 | "bytes", |
| 1018 | "fnv", | 699 | "fnv", |
| @@ -1020,14 +701,26 @@ dependencies = [ | |||
| 1020 | ] | 701 | ] |
| 1021 | 702 | ||
| 1022 | [[package]] | 703 | [[package]] |
| 1023 | name = "http" | 704 | name = "http-body" |
| 1024 | version = "1.3.1" | 705 | version = "1.0.1" |
| 1025 | source = "registry+https://github.com/rust-lang/crates.io-index" | 706 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1026 | checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" | 707 | checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" |
| 1027 | dependencies = [ | 708 | dependencies = [ |
| 1028 | "bytes", | 709 | "bytes", |
| 1029 | "fnv", | 710 | "http", |
| 1030 | "itoa", | 711 | ] |
| 712 | |||
| 713 | [[package]] | ||
| 714 | name = "http-body-util" | ||
| 715 | version = "0.1.3" | ||
| 716 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 717 | checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" | ||
| 718 | dependencies = [ | ||
| 719 | "bytes", | ||
| 720 | "futures-core", | ||
| 721 | "http", | ||
| 722 | "http-body", | ||
| 723 | "pin-project-lite", | ||
| 1031 | ] | 724 | ] |
| 1032 | 725 | ||
| 1033 | [[package]] | 726 | [[package]] |
| @@ -1043,6 +736,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 1043 | checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" | 736 | checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" |
| 1044 | 737 | ||
| 1045 | [[package]] | 738 | [[package]] |
| 739 | name = "hyper" | ||
| 740 | version = "1.8.1" | ||
| 741 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 742 | checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" | ||
| 743 | dependencies = [ | ||
| 744 | "atomic-waker", | ||
| 745 | "bytes", | ||
| 746 | "futures-channel", | ||
| 747 | "futures-core", | ||
| 748 | "h2", | ||
| 749 | "http", | ||
| 750 | "http-body", | ||
| 751 | "httparse", | ||
| 752 | "httpdate", | ||
| 753 | "itoa", | ||
| 754 | "pin-project-lite", | ||
| 755 | "pin-utils", | ||
| 756 | "smallvec", | ||
| 757 | "tokio", | ||
| 758 | "want", | ||
| 759 | ] | ||
| 760 | |||
| 761 | [[package]] | ||
| 762 | name = "hyper-util" | ||
| 763 | version = "0.1.18" | ||
| 764 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 765 | checksum = "52e9a2a24dc5c6821e71a7030e1e14b7b632acac55c40e9d2e082c621261bb56" | ||
| 766 | dependencies = [ | ||
| 767 | "bytes", | ||
| 768 | "futures-core", | ||
| 769 | "http", | ||
| 770 | "http-body", | ||
| 771 | "hyper", | ||
| 772 | "pin-project-lite", | ||
| 773 | "tokio", | ||
| 774 | ] | ||
| 775 | |||
| 776 | [[package]] | ||
| 1046 | name = "iana-time-zone" | 777 | name = "iana-time-zone" |
| 1047 | version = "0.1.64" | 778 | version = "0.1.64" |
| 1048 | source = "registry+https://github.com/rust-lang/crates.io-index" | 779 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -1169,12 +900,6 @@ dependencies = [ | |||
| 1169 | ] | 900 | ] |
| 1170 | 901 | ||
| 1171 | [[package]] | 902 | [[package]] |
| 1172 | name = "impl-more" | ||
| 1173 | version = "0.1.9" | ||
| 1174 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1175 | checksum = "e8a5a9a0ff0086c7a148acb942baaabeadf9504d10400b5a05645853729b9cd2" | ||
| 1176 | |||
| 1177 | [[package]] | ||
| 1178 | name = "indexmap" | 903 | name = "indexmap" |
| 1179 | version = "2.12.0" | 904 | version = "2.12.0" |
| 1180 | source = "registry+https://github.com/rust-lang/crates.io-index" | 905 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -1219,16 +944,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 1219 | checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" | 944 | checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" |
| 1220 | 945 | ||
| 1221 | [[package]] | 946 | [[package]] |
| 1222 | name = "jobserver" | ||
| 1223 | version = "0.1.34" | ||
| 1224 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1225 | checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" | ||
| 1226 | dependencies = [ | ||
| 1227 | "getrandom 0.3.4", | ||
| 1228 | "libc", | ||
| 1229 | ] | ||
| 1230 | |||
| 1231 | [[package]] | ||
| 1232 | name = "js-sys" | 947 | name = "js-sys" |
| 1233 | version = "0.3.82" | 948 | version = "0.3.82" |
| 1234 | source = "registry+https://github.com/rust-lang/crates.io-index" | 949 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -1239,12 +954,6 @@ dependencies = [ | |||
| 1239 | ] | 954 | ] |
| 1240 | 955 | ||
| 1241 | [[package]] | 956 | [[package]] |
| 1242 | name = "language-tags" | ||
| 1243 | version = "0.3.2" | ||
| 1244 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1245 | checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" | ||
| 1246 | |||
| 1247 | [[package]] | ||
| 1248 | name = "lazy_static" | 957 | name = "lazy_static" |
| 1249 | version = "1.5.0" | 958 | version = "1.5.0" |
| 1250 | source = "registry+https://github.com/rust-lang/crates.io-index" | 959 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -1263,23 +972,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 1263 | checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" | 972 | checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" |
| 1264 | 973 | ||
| 1265 | [[package]] | 974 | [[package]] |
| 1266 | name = "local-channel" | ||
| 1267 | version = "0.1.5" | ||
| 1268 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1269 | checksum = "b6cbc85e69b8df4b8bb8b89ec634e7189099cea8927a276b7384ce5488e53ec8" | ||
| 1270 | dependencies = [ | ||
| 1271 | "futures-core", | ||
| 1272 | "futures-sink", | ||
| 1273 | "local-waker", | ||
| 1274 | ] | ||
| 1275 | |||
| 1276 | [[package]] | ||
| 1277 | name = "local-waker" | ||
| 1278 | version = "0.1.4" | ||
| 1279 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1280 | checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" | ||
| 1281 | |||
| 1282 | [[package]] | ||
| 1283 | name = "lock_api" | 975 | name = "lock_api" |
| 1284 | version = "0.4.14" | 976 | version = "0.4.14" |
| 1285 | source = "registry+https://github.com/rust-lang/crates.io-index" | 977 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -1316,29 +1008,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 1316 | checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" | 1008 | checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" |
| 1317 | 1009 | ||
| 1318 | [[package]] | 1010 | [[package]] |
| 1319 | name = "mime" | ||
| 1320 | version = "0.3.17" | ||
| 1321 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1322 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" | ||
| 1323 | |||
| 1324 | [[package]] | ||
| 1325 | name = "miniz_oxide" | ||
| 1326 | version = "0.8.9" | ||
| 1327 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1328 | checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" | ||
| 1329 | dependencies = [ | ||
| 1330 | "adler2", | ||
| 1331 | "simd-adler32", | ||
| 1332 | ] | ||
| 1333 | |||
| 1334 | [[package]] | ||
| 1335 | name = "mio" | 1011 | name = "mio" |
| 1336 | version = "1.1.0" | 1012 | version = "1.1.0" |
| 1337 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1013 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1338 | checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" | 1014 | checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" |
| 1339 | dependencies = [ | 1015 | dependencies = [ |
| 1340 | "libc", | 1016 | "libc", |
| 1341 | "log", | ||
| 1342 | "wasi", | 1017 | "wasi", |
| 1343 | "windows-sys 0.61.2", | 1018 | "windows-sys 0.61.2", |
| 1344 | ] | 1019 | ] |
| @@ -1353,12 +1028,14 @@ checksum = "f0efe882e02d206d8d279c20eb40e03baf7cb5136a1476dc084a324fbc3ec42d" | |||
| 1353 | name = "ngit-grasp" | 1028 | name = "ngit-grasp" |
| 1354 | version = "0.1.0" | 1029 | version = "0.1.0" |
| 1355 | dependencies = [ | 1030 | dependencies = [ |
| 1356 | "actix-web", | ||
| 1357 | "actix-ws", | ||
| 1358 | "anyhow", | 1031 | "anyhow", |
| 1032 | "base64", | ||
| 1359 | "dotenvy", | 1033 | "dotenvy", |
| 1360 | "futures-util", | 1034 | "futures-util", |
| 1361 | "grasp-audit", | 1035 | "grasp-audit", |
| 1036 | "http-body-util", | ||
| 1037 | "hyper", | ||
| 1038 | "hyper-util", | ||
| 1362 | "nostr-relay-builder", | 1039 | "nostr-relay-builder", |
| 1363 | "nostr-sdk 0.44.1", | 1040 | "nostr-sdk 0.44.1", |
| 1364 | "serde", | 1041 | "serde", |
| @@ -1366,7 +1043,6 @@ dependencies = [ | |||
| 1366 | "thiserror 1.0.69", | 1043 | "thiserror 1.0.69", |
| 1367 | "tokio", | 1044 | "tokio", |
| 1368 | "tokio-test", | 1045 | "tokio-test", |
| 1369 | "tokio-tungstenite 0.28.0", | ||
| 1370 | "tracing", | 1046 | "tracing", |
| 1371 | "tracing-subscriber", | 1047 | "tracing-subscriber", |
| 1372 | "url", | 1048 | "url", |
| @@ -1540,12 +1216,6 @@ dependencies = [ | |||
| 1540 | ] | 1216 | ] |
| 1541 | 1217 | ||
| 1542 | [[package]] | 1218 | [[package]] |
| 1543 | name = "num-conv" | ||
| 1544 | version = "0.1.0" | ||
| 1545 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1546 | checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" | ||
| 1547 | |||
| 1548 | [[package]] | ||
| 1549 | name = "num-traits" | 1219 | name = "num-traits" |
| 1550 | version = "0.2.19" | 1220 | version = "0.2.19" |
| 1551 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1221 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -1635,12 +1305,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 1635 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" | 1305 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" |
| 1636 | 1306 | ||
| 1637 | [[package]] | 1307 | [[package]] |
| 1638 | name = "pkg-config" | ||
| 1639 | version = "0.3.32" | ||
| 1640 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1641 | checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" | ||
| 1642 | |||
| 1643 | [[package]] | ||
| 1644 | name = "poly1305" | 1308 | name = "poly1305" |
| 1645 | version = "0.8.0" | 1309 | version = "0.8.0" |
| 1646 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1310 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -1661,12 +1325,6 @@ dependencies = [ | |||
| 1661 | ] | 1325 | ] |
| 1662 | 1326 | ||
| 1663 | [[package]] | 1327 | [[package]] |
| 1664 | name = "powerfmt" | ||
| 1665 | version = "0.2.0" | ||
| 1666 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1667 | checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" | ||
| 1668 | |||
| 1669 | [[package]] | ||
| 1670 | name = "ppv-lite86" | 1328 | name = "ppv-lite86" |
| 1671 | version = "0.2.21" | 1329 | version = "0.2.21" |
| 1672 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1330 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -1768,18 +1426,6 @@ dependencies = [ | |||
| 1768 | ] | 1426 | ] |
| 1769 | 1427 | ||
| 1770 | [[package]] | 1428 | [[package]] |
| 1771 | name = "regex" | ||
| 1772 | version = "1.12.2" | ||
| 1773 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1774 | checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" | ||
| 1775 | dependencies = [ | ||
| 1776 | "aho-corasick", | ||
| 1777 | "memchr", | ||
| 1778 | "regex-automata", | ||
| 1779 | "regex-syntax", | ||
| 1780 | ] | ||
| 1781 | |||
| 1782 | [[package]] | ||
| 1783 | name = "regex-automata" | 1429 | name = "regex-automata" |
| 1784 | version = "0.4.13" | 1430 | version = "0.4.13" |
| 1785 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1431 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -1791,12 +1437,6 @@ dependencies = [ | |||
| 1791 | ] | 1437 | ] |
| 1792 | 1438 | ||
| 1793 | [[package]] | 1439 | [[package]] |
| 1794 | name = "regex-lite" | ||
| 1795 | version = "0.1.8" | ||
| 1796 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1797 | checksum = "8d942b98df5e658f56f20d592c7f868833fe38115e65c33003d8cd224b0155da" | ||
| 1798 | |||
| 1799 | [[package]] | ||
| 1800 | name = "regex-syntax" | 1440 | name = "regex-syntax" |
| 1801 | version = "0.8.8" | 1441 | version = "0.8.8" |
| 1802 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1442 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -1953,18 +1593,6 @@ dependencies = [ | |||
| 1953 | ] | 1593 | ] |
| 1954 | 1594 | ||
| 1955 | [[package]] | 1595 | [[package]] |
| 1956 | name = "serde_urlencoded" | ||
| 1957 | version = "0.7.1" | ||
| 1958 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1959 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" | ||
| 1960 | dependencies = [ | ||
| 1961 | "form_urlencoded", | ||
| 1962 | "itoa", | ||
| 1963 | "ryu", | ||
| 1964 | "serde", | ||
| 1965 | ] | ||
| 1966 | |||
| 1967 | [[package]] | ||
| 1968 | name = "sha1" | 1596 | name = "sha1" |
| 1969 | version = "0.10.6" | 1597 | version = "0.10.6" |
| 1970 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1598 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -2011,12 +1639,6 @@ dependencies = [ | |||
| 2011 | ] | 1639 | ] |
| 2012 | 1640 | ||
| 2013 | [[package]] | 1641 | [[package]] |
| 2014 | name = "simd-adler32" | ||
| 2015 | version = "0.3.7" | ||
| 2016 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2017 | checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" | ||
| 2018 | |||
| 2019 | [[package]] | ||
| 2020 | name = "slab" | 1642 | name = "slab" |
| 2021 | version = "0.4.11" | 1643 | version = "0.4.11" |
| 2022 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1644 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -2030,16 +1652,6 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" | |||
| 2030 | 1652 | ||
| 2031 | [[package]] | 1653 | [[package]] |
| 2032 | name = "socket2" | 1654 | name = "socket2" |
| 2033 | version = "0.5.10" | ||
| 2034 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2035 | checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" | ||
| 2036 | dependencies = [ | ||
| 2037 | "libc", | ||
| 2038 | "windows-sys 0.52.0", | ||
| 2039 | ] | ||
| 2040 | |||
| 2041 | [[package]] | ||
| 2042 | name = "socket2" | ||
| 2043 | version = "0.6.1" | 1655 | version = "0.6.1" |
| 2044 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1656 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 2045 | checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" | 1657 | checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" |
| @@ -2138,37 +1750,6 @@ dependencies = [ | |||
| 2138 | ] | 1750 | ] |
| 2139 | 1751 | ||
| 2140 | [[package]] | 1752 | [[package]] |
| 2141 | name = "time" | ||
| 2142 | version = "0.3.44" | ||
| 2143 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2144 | checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" | ||
| 2145 | dependencies = [ | ||
| 2146 | "deranged", | ||
| 2147 | "itoa", | ||
| 2148 | "num-conv", | ||
| 2149 | "powerfmt", | ||
| 2150 | "serde", | ||
| 2151 | "time-core", | ||
| 2152 | "time-macros", | ||
| 2153 | ] | ||
| 2154 | |||
| 2155 | [[package]] | ||
| 2156 | name = "time-core" | ||
| 2157 | version = "0.1.6" | ||
| 2158 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2159 | checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" | ||
| 2160 | |||
| 2161 | [[package]] | ||
| 2162 | name = "time-macros" | ||
| 2163 | version = "0.2.24" | ||
| 2164 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2165 | checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" | ||
| 2166 | dependencies = [ | ||
| 2167 | "num-conv", | ||
| 2168 | "time-core", | ||
| 2169 | ] | ||
| 2170 | |||
| 2171 | [[package]] | ||
| 2172 | name = "tinystr" | 1753 | name = "tinystr" |
| 2173 | version = "0.8.2" | 1754 | version = "0.8.2" |
| 2174 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1755 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -2205,7 +1786,7 @@ dependencies = [ | |||
| 2205 | "parking_lot", | 1786 | "parking_lot", |
| 2206 | "pin-project-lite", | 1787 | "pin-project-lite", |
| 2207 | "signal-hook-registry", | 1788 | "signal-hook-registry", |
| 2208 | "socket2 0.6.1", | 1789 | "socket2", |
| 2209 | "tokio-macros", | 1790 | "tokio-macros", |
| 2210 | "windows-sys 0.61.2", | 1791 | "windows-sys 0.61.2", |
| 2211 | ] | 1792 | ] |
| @@ -2279,23 +1860,11 @@ dependencies = [ | |||
| 2279 | "rustls-pki-types", | 1860 | "rustls-pki-types", |
| 2280 | "tokio", | 1861 | "tokio", |
| 2281 | "tokio-rustls", | 1862 | "tokio-rustls", |
| 2282 | "tungstenite 0.26.2", | 1863 | "tungstenite", |
| 2283 | "webpki-roots 0.26.11", | 1864 | "webpki-roots 0.26.11", |
| 2284 | ] | 1865 | ] |
| 2285 | 1866 | ||
| 2286 | [[package]] | 1867 | [[package]] |
| 2287 | name = "tokio-tungstenite" | ||
| 2288 | version = "0.28.0" | ||
| 2289 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2290 | checksum = "d25a406cddcc431a75d3d9afc6a7c0f7428d4891dd973e4d54c56b46127bf857" | ||
| 2291 | dependencies = [ | ||
| 2292 | "futures-util", | ||
| 2293 | "log", | ||
| 2294 | "tokio", | ||
| 2295 | "tungstenite 0.28.0", | ||
| 2296 | ] | ||
| 2297 | |||
| 2298 | [[package]] | ||
| 2299 | name = "tokio-util" | 1868 | name = "tokio-util" |
| 2300 | version = "0.7.17" | 1869 | version = "0.7.17" |
| 2301 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1870 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -2314,7 +1883,6 @@ version = "0.1.41" | |||
| 2314 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1883 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 2315 | checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" | 1884 | checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" |
| 2316 | dependencies = [ | 1885 | dependencies = [ |
| 2317 | "log", | ||
| 2318 | "pin-project-lite", | 1886 | "pin-project-lite", |
| 2319 | "tracing-attributes", | 1887 | "tracing-attributes", |
| 2320 | "tracing-core", | 1888 | "tracing-core", |
| @@ -2371,6 +1939,12 @@ dependencies = [ | |||
| 2371 | ] | 1939 | ] |
| 2372 | 1940 | ||
| 2373 | [[package]] | 1941 | [[package]] |
| 1942 | name = "try-lock" | ||
| 1943 | version = "0.2.5" | ||
| 1944 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1945 | checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" | ||
| 1946 | |||
| 1947 | [[package]] | ||
| 2374 | name = "tungstenite" | 1948 | name = "tungstenite" |
| 2375 | version = "0.26.2" | 1949 | version = "0.26.2" |
| 2376 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1950 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -2378,7 +1952,7 @@ checksum = "4793cb5e56680ecbb1d843515b23b6de9a75eb04b66643e256a396d43be33c13" | |||
| 2378 | dependencies = [ | 1952 | dependencies = [ |
| 2379 | "bytes", | 1953 | "bytes", |
| 2380 | "data-encoding", | 1954 | "data-encoding", |
| 2381 | "http 1.3.1", | 1955 | "http", |
| 2382 | "httparse", | 1956 | "httparse", |
| 2383 | "log", | 1957 | "log", |
| 2384 | "rand 0.9.2", | 1958 | "rand 0.9.2", |
| @@ -2390,23 +1964,6 @@ dependencies = [ | |||
| 2390 | ] | 1964 | ] |
| 2391 | 1965 | ||
| 2392 | [[package]] | 1966 | [[package]] |
| 2393 | name = "tungstenite" | ||
| 2394 | version = "0.28.0" | ||
| 2395 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2396 | checksum = "8628dcc84e5a09eb3d8423d6cb682965dea9133204e8fb3efee74c2a0c259442" | ||
| 2397 | dependencies = [ | ||
| 2398 | "bytes", | ||
| 2399 | "data-encoding", | ||
| 2400 | "http 1.3.1", | ||
| 2401 | "httparse", | ||
| 2402 | "log", | ||
| 2403 | "rand 0.9.2", | ||
| 2404 | "sha1", | ||
| 2405 | "thiserror 2.0.17", | ||
| 2406 | "utf-8", | ||
| 2407 | ] | ||
| 2408 | |||
| 2409 | [[package]] | ||
| 2410 | name = "typenum" | 1967 | name = "typenum" |
| 2411 | version = "1.19.0" | 1968 | version = "1.19.0" |
| 2412 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1969 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -2428,12 +1985,6 @@ dependencies = [ | |||
| 2428 | ] | 1985 | ] |
| 2429 | 1986 | ||
| 2430 | [[package]] | 1987 | [[package]] |
| 2431 | name = "unicode-xid" | ||
| 2432 | version = "0.2.6" | ||
| 2433 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2434 | checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" | ||
| 2435 | |||
| 2436 | [[package]] | ||
| 2437 | name = "universal-hash" | 1988 | name = "universal-hash" |
| 2438 | version = "0.5.1" | 1989 | version = "0.5.1" |
| 2439 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1990 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -2503,6 +2054,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 2503 | checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" | 2054 | checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" |
| 2504 | 2055 | ||
| 2505 | [[package]] | 2056 | [[package]] |
| 2057 | name = "want" | ||
| 2058 | version = "0.3.1" | ||
| 2059 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2060 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" | ||
| 2061 | dependencies = [ | ||
| 2062 | "try-lock", | ||
| 2063 | ] | ||
| 2064 | |||
| 2065 | [[package]] | ||
| 2506 | name = "wasi" | 2066 | name = "wasi" |
| 2507 | version = "0.11.1+wasi-snapshot-preview1" | 2067 | version = "0.11.1+wasi-snapshot-preview1" |
| 2508 | source = "registry+https://github.com/rust-lang/crates.io-index" | 2068 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -2932,31 +2492,3 @@ dependencies = [ | |||
| 2932 | "quote", | 2492 | "quote", |
| 2933 | "syn", | 2493 | "syn", |
| 2934 | ] | 2494 | ] |
| 2935 | |||
| 2936 | [[package]] | ||
| 2937 | name = "zstd" | ||
| 2938 | version = "0.13.3" | ||
| 2939 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2940 | checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" | ||
| 2941 | dependencies = [ | ||
| 2942 | "zstd-safe", | ||
| 2943 | ] | ||
| 2944 | |||
| 2945 | [[package]] | ||
| 2946 | name = "zstd-safe" | ||
| 2947 | version = "7.2.4" | ||
| 2948 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2949 | checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" | ||
| 2950 | dependencies = [ | ||
| 2951 | "zstd-sys", | ||
| 2952 | ] | ||
| 2953 | |||
| 2954 | [[package]] | ||
| 2955 | name = "zstd-sys" | ||
| 2956 | version = "2.0.16+zstd.1.5.7" | ||
| 2957 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2958 | checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" | ||
| 2959 | dependencies = [ | ||
| 2960 | "cc", | ||
| 2961 | "pkg-config", | ||
| 2962 | ] | ||
| @@ -11,9 +11,10 @@ repository = "https://gitworkshop.dev/ngit-grasp" | |||
| 11 | # Async runtime | 11 | # Async runtime |
| 12 | tokio = { version = "1.35", features = ["full"] } | 12 | tokio = { version = "1.35", features = ["full"] } |
| 13 | 13 | ||
| 14 | # HTTP server | 14 | # HTTP server (hyper for relay integration) |
| 15 | actix-web = "4.4" | 15 | hyper = { version = "1.4", features = ["full"] } |
| 16 | actix-ws = "0.3" | 16 | hyper-util = { version = "0.1", features = ["tokio", "server", "http1", "http2"] } |
| 17 | http-body-util = "0.1" | ||
| 17 | 18 | ||
| 18 | # Nostr relay | 19 | # Nostr relay |
| 19 | nostr-relay-builder = "0.44" | 20 | nostr-relay-builder = "0.44" |
| @@ -23,6 +24,7 @@ nostr-sdk = "0.44" | |||
| 23 | 24 | ||
| 24 | # Utilities | 25 | # Utilities |
| 25 | futures-util = "0.3" | 26 | futures-util = "0.3" |
| 27 | base64 = "0.22" | ||
| 26 | 28 | ||
| 27 | # Serialization | 29 | # Serialization |
| 28 | serde = { version = "1.0", features = ["derive"] } | 30 | serde = { version = "1.0", features = ["derive"] } |
| @@ -38,7 +40,6 @@ dotenvy = "0.15" | |||
| 38 | # Error handling | 40 | # Error handling |
| 39 | anyhow = "1.0" | 41 | anyhow = "1.0" |
| 40 | thiserror = "1.0" | 42 | thiserror = "1.0" |
| 41 | tokio-tungstenite = "0.28.0" | ||
| 42 | 43 | ||
| 43 | # Git (for future use) | 44 | # Git (for future use) |
| 44 | # git-http-backend = "0.3" | 45 | # git-http-backend = "0.3" |
diff --git a/src/http/landing.rs b/src/http/landing.rs index 976ec50..55ffb26 100644 --- a/src/http/landing.rs +++ b/src/http/landing.rs | |||
| @@ -1,40 +1,15 @@ | |||
| 1 | /// Landing Page Handler | 1 | /// Landing Page Handler |
| 2 | /// | 2 | /// |
| 3 | /// Serves the HTML landing page or upgrades to WebSocket for Nostr relay connections. | 3 | /// Generates HTML landing page for the Nostr relay. |
| 4 | use actix_web::{web, HttpRequest, HttpResponse, Result}; | ||
| 5 | use nostr_relay_builder::LocalRelay; | ||
| 6 | |||
| 7 | use crate::config::Config; | 4 | use crate::config::Config; |
| 8 | 5 | ||
| 9 | /// Handle landing page or WebSocket upgrade | 6 | /// Generate the HTML landing page |
| 10 | pub async fn handle( | 7 | pub fn get_html(config: &Config) -> String { |
| 11 | req: HttpRequest, | 8 | format!( |
| 12 | stream: web::Payload, | ||
| 13 | config: web::Data<Config>, | ||
| 14 | relay: web::Data<LocalRelay>, | ||
| 15 | ) -> Result<HttpResponse> { | ||
| 16 | // Check if this is a WebSocket upgrade request | ||
| 17 | if let Some(upgrade) = req.headers().get("upgrade") { | ||
| 18 | if upgrade | ||
| 19 | .to_str() | ||
| 20 | .unwrap_or("") | ||
| 21 | .eq_ignore_ascii_case("websocket") | ||
| 22 | { | ||
| 23 | // Delegate to WebSocket handler | ||
| 24 | return crate::http::websocket::handle(req, stream, relay).await; | ||
| 25 | } | ||
| 26 | } | ||
| 27 | |||
| 28 | // Otherwise, serve the landing page | ||
| 29 | let html = format!( | ||
| 30 | include_str!("../../templates/landing.html"), | 9 | include_str!("../../templates/landing.html"), |
| 31 | relay_name = config.relay_name, | 10 | relay_name = config.relay_name, |
| 32 | relay_description = config.relay_description, | 11 | relay_description = config.relay_description, |
| 33 | domain = config.domain, | 12 | domain = config.domain, |
| 34 | bind_address = config.bind_address, | 13 | bind_address = config.bind_address, |
| 35 | ); | 14 | ) |
| 36 | |||
| 37 | Ok(HttpResponse::Ok() | ||
| 38 | .content_type("text/html; charset=utf-8") | ||
| 39 | .body(html)) | ||
| 40 | } | 15 | } |
diff --git a/src/http/mod.rs b/src/http/mod.rs index b434c69..4690790 100644 --- a/src/http/mod.rs +++ b/src/http/mod.rs | |||
| @@ -1,30 +1,140 @@ | |||
| 1 | /// HTTP Server Module | 1 | /// HTTP Server Module |
| 2 | /// | 2 | /// |
| 3 | /// Provides actix-web HTTP server with WebSocket upgrade support for the Nostr relay. | 3 | /// Provides hyper HTTP server with WebSocket upgrade support for the Nostr relay. |
| 4 | pub mod landing; | 4 | pub mod landing; |
| 5 | pub mod websocket; | ||
| 6 | 5 | ||
| 7 | use actix_web::{middleware, web, App, HttpServer}; | 6 | use std::future::Future; |
| 7 | use std::net::SocketAddr; | ||
| 8 | use std::pin::Pin; | ||
| 9 | |||
| 10 | use hyper::body::Incoming; | ||
| 11 | use hyper::header::{CONNECTION, SEC_WEBSOCKET_ACCEPT, UPGRADE}; | ||
| 12 | use hyper::server::conn::http1; | ||
| 13 | use hyper::service::Service; | ||
| 14 | use hyper::{Request, Response}; | ||
| 15 | use hyper_util::rt::TokioIo; | ||
| 16 | use nostr_sdk::hashes::sha1::Hash as Sha1Hash; | ||
| 17 | use nostr_sdk::hashes::{Hash, HashEngine}; | ||
| 8 | use nostr_relay_builder::LocalRelay; | 18 | use nostr_relay_builder::LocalRelay; |
| 19 | use tokio::net::TcpListener; | ||
| 20 | use base64::Engine; | ||
| 9 | 21 | ||
| 10 | use crate::config::Config; | 22 | use crate::config::Config; |
| 11 | 23 | ||
| 24 | /// HTTP Service that serves both WebSocket (relay) and HTML landing page | ||
| 25 | struct HttpService { | ||
| 26 | relay: LocalRelay, | ||
| 27 | config: Config, | ||
| 28 | remote: SocketAddr, | ||
| 29 | } | ||
| 30 | |||
| 31 | impl HttpService { | ||
| 32 | fn new(relay: LocalRelay, config: Config, remote: SocketAddr) -> Self { | ||
| 33 | Self { | ||
| 34 | relay, | ||
| 35 | config, | ||
| 36 | remote, | ||
| 37 | } | ||
| 38 | } | ||
| 39 | } | ||
| 40 | |||
| 41 | impl Service<Request<Incoming>> for HttpService { | ||
| 42 | type Response = Response<String>; | ||
| 43 | type Error = String; | ||
| 44 | type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>; | ||
| 45 | |||
| 46 | fn call(&self, req: Request<Incoming>) -> Self::Future { | ||
| 47 | let base = Response::builder().header("server", "ngit-grasp"); | ||
| 48 | |||
| 49 | // Check if this is a WebSocket upgrade request | ||
| 50 | if let (Some(c), Some(w)) = ( | ||
| 51 | req.headers().get("connection"), | ||
| 52 | req.headers().get("upgrade"), | ||
| 53 | ) { | ||
| 54 | if c.to_str() | ||
| 55 | .map(|s| s.to_lowercase() == "upgrade") | ||
| 56 | .unwrap_or(false) | ||
| 57 | && w.to_str() | ||
| 58 | .map(|s| s.to_lowercase() == "websocket") | ||
| 59 | .unwrap_or(false) | ||
| 60 | { | ||
| 61 | let key = req.headers().get("sec-websocket-key"); | ||
| 62 | let derived = key.map(|k| derive_accept_key(k.as_bytes())); | ||
| 63 | |||
| 64 | let addr = self.remote; | ||
| 65 | let relay = self.relay.clone(); | ||
| 66 | |||
| 67 | tokio::spawn(async move { | ||
| 68 | match hyper::upgrade::on(req).await { | ||
| 69 | Ok(upgraded) => { | ||
| 70 | tracing::info!("WebSocket connection established from {}", addr); | ||
| 71 | if let Err(e) = relay.take_connection(TokioIo::new(upgraded), addr).await | ||
| 72 | { | ||
| 73 | tracing::error!("Relay error for {}: {}", addr, e); | ||
| 74 | } | ||
| 75 | tracing::info!("WebSocket connection closed for {}", addr); | ||
| 76 | } | ||
| 77 | Err(e) => tracing::error!("Upgrade error: {}", e), | ||
| 78 | } | ||
| 79 | }); | ||
| 80 | |||
| 81 | return Box::pin(async move { | ||
| 82 | Ok(base | ||
| 83 | .status(101) | ||
| 84 | .header(CONNECTION, "upgrade") | ||
| 85 | .header(UPGRADE, "websocket") | ||
| 86 | .header(SEC_WEBSOCKET_ACCEPT, derived.unwrap()) | ||
| 87 | .body("".to_string()) | ||
| 88 | .unwrap()) | ||
| 89 | }); | ||
| 90 | } | ||
| 91 | } | ||
| 92 | |||
| 93 | // Serve landing page for HTTP requests | ||
| 94 | let html = landing::get_html(&self.config); | ||
| 95 | Box::pin(async move { | ||
| 96 | Ok(base | ||
| 97 | .status(200) | ||
| 98 | .header("content-type", "text/html; charset=utf-8") | ||
| 99 | .body(html) | ||
| 100 | .unwrap()) | ||
| 101 | }) | ||
| 102 | } | ||
| 103 | } | ||
| 104 | |||
| 105 | /// Derive the `Sec-WebSocket-Accept` response header from a `Sec-WebSocket-Key` request header | ||
| 106 | fn derive_accept_key(request_key: &[u8]) -> String { | ||
| 107 | const WS_GUID: &[u8] = b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; | ||
| 108 | let mut engine = Sha1Hash::engine(); | ||
| 109 | engine.input(request_key); | ||
| 110 | engine.input(WS_GUID); | ||
| 111 | let hash: Sha1Hash = Sha1Hash::from_engine(engine); | ||
| 112 | base64::prelude::BASE64_STANDARD.encode(hash) | ||
| 113 | } | ||
| 114 | |||
| 12 | /// Start the HTTP server with integrated Nostr relay | 115 | /// Start the HTTP server with integrated Nostr relay |
| 13 | pub async fn run_server(config: Config, relay: LocalRelay) -> anyhow::Result<()> { | 116 | pub async fn run_server(config: Config, relay: LocalRelay) -> anyhow::Result<()> { |
| 14 | let bind_addr = config.bind_address.clone(); | 117 | let bind_addr: SocketAddr = config.bind_address.parse()?; |
| 15 | 118 | ||
| 16 | tracing::info!("Starting HTTP server on {}", bind_addr); | 119 | tracing::info!("Starting HTTP server on {}", bind_addr); |
| 120 | tracing::info!("Relay name: {}", config.relay_name); | ||
| 121 | tracing::info!("Domain: {}", config.domain); | ||
| 17 | 122 | ||
| 18 | HttpServer::new(move || { | 123 | let listener = TcpListener::bind(&bind_addr).await?; |
| 19 | App::new() | 124 | |
| 20 | .app_data(web::Data::new(config.clone())) | 125 | loop { |
| 21 | .app_data(web::Data::new(relay.clone())) | 126 | let (socket, addr) = listener.accept().await?; |
| 22 | .wrap(middleware::Logger::default()) | 127 | let io = TokioIo::new(socket); |
| 23 | .route("/", web::get().to(landing::handle)) | 128 | let service = HttpService::new(relay.clone(), config.clone(), addr); |
| 24 | }) | 129 | |
| 25 | .bind(&bind_addr)? | 130 | tokio::spawn(async move { |
| 26 | .run() | 131 | if let Err(e) = http1::Builder::new() |
| 27 | .await?; | 132 | .serve_connection(io, service) |
| 28 | 133 | .with_upgrades() | |
| 29 | Ok(()) | 134 | .await |
| 135 | { | ||
| 136 | tracing::error!("Failed to handle request from {}: {}", addr, e); | ||
| 137 | } | ||
| 138 | }); | ||
| 139 | } | ||
| 30 | } | 140 | } |
diff --git a/src/http/websocket.rs b/src/http/websocket.rs deleted file mode 100644 index 0171013..0000000 --- a/src/http/websocket.rs +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 1 | /// WebSocket Handler | ||
| 2 | /// | ||
| 3 | /// Handles WebSocket upgrade requests and passes connections to the Nostr relay. | ||
| 4 | use actix_web::{web, Error, HttpRequest, HttpResponse, Result}; | ||
| 5 | use actix_ws::Message; | ||
| 6 | use futures_util::StreamExt; | ||
| 7 | use nostr_relay_builder::LocalRelay; | ||
| 8 | |||
| 9 | /// Handle WebSocket upgrade and relay connection | ||
| 10 | pub async fn handle( | ||
| 11 | req: HttpRequest, | ||
| 12 | stream: web::Payload, | ||
| 13 | relay: web::Data<LocalRelay>, | ||
| 14 | ) -> Result<HttpResponse, Error> { | ||
| 15 | let (response, mut session, mut msg_stream) = actix_ws::handle(&req, stream)?; | ||
| 16 | |||
| 17 | let peer_addr = req | ||
| 18 | .peer_addr() | ||
| 19 | .unwrap_or_else(|| "0.0.0.0:0".parse().unwrap()); | ||
| 20 | |||
| 21 | tracing::debug!("WebSocket connection from {}", peer_addr); | ||
| 22 | |||
| 23 | // Spawn task to handle the WebSocket connection | ||
| 24 | // TODO: Will use relay.take_connection() for full Nostr relay integration | ||
| 25 | let _relay = relay.get_ref().clone(); | ||
| 26 | actix_web::rt::spawn(async move { | ||
| 27 | // Create a channel to communicate between actix-ws and relay | ||
| 28 | let (tx, mut rx) = tokio::sync::mpsc::unbounded_channel(); | ||
| 29 | |||
| 30 | // Spawn task to send messages from relay to client | ||
| 31 | let mut session_clone = session.clone(); | ||
| 32 | actix_web::rt::spawn(async move { | ||
| 33 | while let Some(msg) = rx.recv().await { | ||
| 34 | if session_clone.text(msg).await.is_err() { | ||
| 35 | break; | ||
| 36 | } | ||
| 37 | } | ||
| 38 | }); | ||
| 39 | |||
| 40 | // Handle incoming messages from client | ||
| 41 | while let Some(Ok(msg)) = msg_stream.next().await { | ||
| 42 | match msg { | ||
| 43 | Message::Text(text) => { | ||
| 44 | // For now, just echo back - will integrate with relay in next phase | ||
| 45 | tracing::debug!("Received text message: {}", text); | ||
| 46 | if let Err(e) = tx.send(text.to_string()) { | ||
| 47 | tracing::error!("Failed to send message: {}", e); | ||
| 48 | break; | ||
| 49 | } | ||
| 50 | } | ||
| 51 | Message::Binary(_) => { | ||
| 52 | tracing::warn!("Received unexpected binary message"); | ||
| 53 | } | ||
| 54 | Message::Close(_) => { | ||
| 55 | tracing::debug!("Client closed connection"); | ||
| 56 | break; | ||
| 57 | } | ||
| 58 | Message::Ping(bytes) => { | ||
| 59 | if session.pong(&bytes).await.is_err() { | ||
| 60 | break; | ||
| 61 | } | ||
| 62 | } | ||
| 63 | Message::Pong(_) => {} | ||
| 64 | Message::Continuation(_) => {} | ||
| 65 | Message::Nop => {} | ||
| 66 | } | ||
| 67 | } | ||
| 68 | |||
| 69 | tracing::debug!("WebSocket connection closed for {}", peer_addr); | ||
| 70 | }); | ||
| 71 | |||
| 72 | Ok(response) | ||
| 73 | } | ||