From 7087e6b131f8ced27c35a7d9c4e2b8148d8769b6 Mon Sep 17 00:00:00 2001 From: MeexReay Date: Mon, 28 Jul 2025 15:09:55 +0300 Subject: [PATCH] write main rs --- Cargo.toml | 2 +- src/main.rs | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index af06b21..d6e72de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,4 +8,4 @@ bcrypt = "0.17.0" clap = { version = "4.5.41", features = ["derive"] } quinn = { version = "0.11.8", features = ["rustls"] } rustls = { version = "0.23.30", features = ["ring"] } -tokio = { version = "1.47.0", features = ["rt", "macros"] } +tokio = { version = "1.47.0", features = ["rt", "macros", "rt-multi-thread"] } diff --git a/src/main.rs b/src/main.rs index 8f724f0..eac492e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,34 @@ +use clap::Parser; + mod client; mod server; -fn main() { - println!("Hello, world!"); +/// Proxy that based on QUIC +#[derive(Parser, Debug)] +#[command(version, about, long_about = None)] +struct Args { + /// Connect to proxy + #[arg(short, long)] + connect: Option, + + /// Bind proxy + #[arg(short, long)] + bind: Option, + + /// Password + #[arg(short, long, default_value = "nope")] + password: String, +} + +#[tokio::main] +async fn main() { + let args = Args::parse(); + + if let Some(host) = args.bind { + todo!() + } else if let Some(host) = args.connect { + todo!() + } else { + println!("choose either --connect or --bind") + } }