force a bounded channel

This commit is contained in:
Toshit Chawda 2024-04-14 17:59:24 -07:00
parent f2021e2382
commit 5af56fe582
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
4 changed files with 35 additions and 28 deletions

View file

@ -92,6 +92,9 @@ struct Cli {
/// Usernames and passwords are sent in plaintext!!
#[arg(long)]
auth: Option<String>,
/// Make a Wisp V1 connection
#[arg(long)]
wisp_v1: bool,
}
#[tokio::main(flavor = "multi_thread")]
@ -161,7 +164,12 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
extensions.push(Box::new(auth));
}
let (mut mux, fut) = ClientMux::new(rx, tx, Some(extensions.as_slice())).await?;
let (mut mux, fut) = if opts.wisp_v1 {
ClientMux::new(rx, tx, None).await?
} else {
ClientMux::new(rx, tx, Some(extensions.as_slice())).await?
};
if opts.udp
&& !mux
.supported_extension_ids