write main rs
This commit is contained in:
parent
f53eaff1f7
commit
7087e6b131
2 changed files with 31 additions and 3 deletions
|
@ -8,4 +8,4 @@ bcrypt = "0.17.0"
|
||||||
clap = { version = "4.5.41", features = ["derive"] }
|
clap = { version = "4.5.41", features = ["derive"] }
|
||||||
quinn = { version = "0.11.8", features = ["rustls"] }
|
quinn = { version = "0.11.8", features = ["rustls"] }
|
||||||
rustls = { version = "0.23.30", features = ["ring"] }
|
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"] }
|
||||||
|
|
32
src/main.rs
32
src/main.rs
|
@ -1,6 +1,34 @@
|
||||||
|
use clap::Parser;
|
||||||
|
|
||||||
mod client;
|
mod client;
|
||||||
mod server;
|
mod server;
|
||||||
|
|
||||||
fn main() {
|
/// Proxy that based on QUIC
|
||||||
println!("Hello, world!");
|
#[derive(Parser, Debug)]
|
||||||
|
#[command(version, about, long_about = None)]
|
||||||
|
struct Args {
|
||||||
|
/// Connect to proxy
|
||||||
|
#[arg(short, long)]
|
||||||
|
connect: Option<String>,
|
||||||
|
|
||||||
|
/// Bind proxy
|
||||||
|
#[arg(short, long)]
|
||||||
|
bind: Option<String>,
|
||||||
|
|
||||||
|
/// 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")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue