🐛 bug: fix start-up order

main
_ 2021-07-17 06:12:16 +00:00
parent 8a976be3be
commit 9ef27ac40f
2 changed files with 10 additions and 9 deletions

View File

@ -1,12 +1,12 @@
# Testing
There are 5 processes, so you'll need 5 terminal windows or screen / tmux
sessions:
sessions. Run the processes in this order:
1. TCP end server: `nc -l -p 30382`
2. QUIC relay server: `RUST_LOG=quic_demo_relay_server=debug cargo run --bin quic_demo_relay_server`
3. Server-side proxy: `RUST_LOG=quic_demo_end_server=debug cargo run --bin quic_demo_end_server`
4. Client-side proxy: `RUST_LOG=quic_demo_client cargo run --bin quic_demo_client`
1. QUIC relay server: `RUST_LOG=quic_demo_relay_server=debug cargo run --bin quic_demo_relay_server`
2. Server-side proxy: `RUST_LOG=quic_demo_end_server=debug cargo run --bin quic_demo_end_server`
3. Client-side proxy: `RUST_LOG=quic_demo_client cargo run --bin quic_demo_client`
4. TCP end server: `nc -l -p 30382`
5. TCP end client: `nc 127.0.0.1 30381`
The netcat processes from steps 1 and 5 should now be connected to each other.

View File

@ -6,10 +6,6 @@ use quic_demo::prelude::*;
async fn main () -> anyhow::Result <()> {
tracing_subscriber::fmt::init ();
let stream = TcpStream::connect ("127.0.0.1:30382").await?;
let (mut local_recv, mut local_send) = stream.into_split ();
let server_cert = tokio::fs::read ("quic_server.crt").await?;
let server_addr = "127.0.0.1:30380".parse ()?;
let endpoint = make_client_endpoint ("0.0.0.0:0".parse ()?, &[&server_cert])?;
@ -25,6 +21,11 @@ async fn main () -> anyhow::Result <()> {
let (mut relay_send, mut relay_recv) = bi_streams.next ().await.ok_or_else (|| anyhow::anyhow! ("Relay server didn't open a bi stream"))??;
debug! ("Connecting to TCP end server");
let stream = TcpStream::connect ("127.0.0.1:30382").await?;
let (mut local_recv, mut local_send) = stream.into_split ();
debug! ("Relaying bytes...");
let uplink_task = tokio::spawn (async move {