From 86e530563044f3c093d7df8ff012e0766b5000fe Mon Sep 17 00:00:00 2001 From: "(on company time)" <_@_> Date: Fri, 16 Dec 2022 15:43:47 -0600 Subject: [PATCH] :construction: wip: start making a place for PTTH_QUIC relay server config --- Cargo.lock | 11 +++++--- crates/ptth_quic/Cargo.toml | 3 ++ .../ptth_quic/src/executable_relay_server.rs | 28 +++++++++++++++++-- crates/ptth_quic/src/prelude.rs | 2 ++ 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 727b9e5..30c5250 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1354,6 +1354,7 @@ name = "ptth_quic" version = "0.1.0" dependencies = [ "anyhow", + "arc-swap", "base64 0.20.0", "ctrlc", "futures-util", @@ -1364,6 +1365,8 @@ dependencies = [ "reqwest", "rmp-serde 1.1.1", "rustls", + "rusty_ulid 1.0.0", + "serde", "structopt", "tokio", "tracing", @@ -1910,18 +1913,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.150" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" +checksum = "97fed41fc1a24994d044e6db6935e69511a1153b52c15eb42493b26fa87feba0" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.150" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" +checksum = "255abe9a125a985c05190d687b320c12f9b1f0b99445e608c21ba0782c719ad8" dependencies = [ "proc-macro2", "quote", diff --git a/crates/ptth_quic/Cargo.toml b/crates/ptth_quic/Cargo.toml index 30f9d16..2175cc3 100644 --- a/crates/ptth_quic/Cargo.toml +++ b/crates/ptth_quic/Cargo.toml @@ -9,6 +9,7 @@ license = "AGPL-3.0" [dependencies] anyhow = "1.0.66" +arc-swap = "1.5.1" base64 = "0.20.0" ctrlc = "3.2.4" futures-util = "0.3.25" @@ -18,6 +19,8 @@ rand = "0.8.5" rcgen = "0.10.0" rmp-serde = "1.1.1" rustls = "0.20.7" +rusty_ulid = "1.0.0" +serde = "1.0.151" structopt = "0.3.26" tokio = { version = "1.23.0", features = ["full"] } tracing-subscriber = "0.3.16" diff --git a/crates/ptth_quic/src/executable_relay_server.rs b/crates/ptth_quic/src/executable_relay_server.rs index fffa727..0e2478f 100644 --- a/crates/ptth_quic/src/executable_relay_server.rs +++ b/crates/ptth_quic/src/executable_relay_server.rs @@ -164,11 +164,22 @@ async fn handle_http (_req: Request
, relay_state: Arc