diff --git a/src/ops/network.rs b/src/ops/network.rs index ec55308..c9cd9bf 100644 --- a/src/ops/network.rs +++ b/src/ops/network.rs @@ -66,7 +66,7 @@ pub struct ForwardProxyCommand { pub listen: String, #[clap(short, long)] - pub sni: String, + pub sni: Option, #[clap(short, long)] pub target: String, @@ -328,7 +328,11 @@ pub async fn forward_proxy(opts: ForwardProxyCommand) -> Result<(), Box s.as_str(), + None => opts.target.as_str(), + }) + .expect("Failed to parse SNI"); loop { let (pt_stream, _) = match listener.accept().await { Ok(s) => s,