diff --git a/docs/how-to/test-ptth-quic.md b/docs/how-to/test-ptth-quic.md index ba2fca8..3bc15a8 100644 --- a/docs/how-to/test-ptth-quic.md +++ b/docs/how-to/test-ptth-quic.md @@ -1,8 +1,20 @@ # How-to: Test PTTH_QUIC -- Put a couple terminals in `prototypes/quic_demo` -- Set up a relay `cargo run --bin quic_demo_relay_server` -- Verify that the relay has no servers connected -- Set up a server -- The relay should refuse the server's connection if its API key is not recognized -- Once the relay recognizes the API key, the server should automatically reconnect +## Initial setup + +- Open 3 terminals in `prototypes/quic_demo` +- Use `export RUST_LOG=quic_demo_relay_server=debug` to enable debug logging +for the terminal that will run the relay server +- Use `export RUST_LOG=quic_demo_end_server=debug` for the terminal that +will run the end server + +When the relay server is running, use curl to get the list of connected +end servers: `curl 127.0.0.1:4004` + +## Test loop - Happy path + +- Start a relay `cargo run --bin quic_demo_relay_server` +- Verify that the relay has no end servers connected +- Start an end server `cargo run --bin quic_demo_end_server` +- Verify that the end server connected + diff --git a/prototypes/quic_demo/src/bin/quic_demo_end_server.rs b/prototypes/quic_demo/src/bin/quic_demo_end_server.rs index 19ba94d..c5a9feb 100644 --- a/prototypes/quic_demo/src/bin/quic_demo_end_server.rs +++ b/prototypes/quic_demo/src/bin/quic_demo_end_server.rs @@ -31,6 +31,7 @@ async fn main () -> anyhow::Result <()> { .. } = protocol::p4_connect_to_p3 (&endpoint, &relay_addr, &server_id).await?; + debug! ("Connected to relay server"); trace! ("Accepting bi streams from P3"); loop { diff --git a/prototypes/quic_demo/src/bin/quic_demo_relay_server.rs b/prototypes/quic_demo/src/bin/quic_demo_relay_server.rs index 72e47d5..f2e51c9 100644 --- a/prototypes/quic_demo/src/bin/quic_demo_relay_server.rs +++ b/prototypes/quic_demo/src/bin/quic_demo_relay_server.rs @@ -56,6 +56,8 @@ async fn main () -> anyhow::Result <()> { http_server.serve (make_svc).await }); + debug! ("Serving HTTP on {:?}", http_addr); + while let Some (conn) = incoming.next ().await { let relay_state = Arc::clone (&relay_state);