Merge pull request #2 from FoxMoss/multiplexed

Procedual GET Arg For The Wisp Client Demo
This commit is contained in:
Toshit 2024-03-03 21:39:43 -08:00 committed by GitHub
commit f1446a9b27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,16 +52,20 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
.ok_or(StrError::new("no src port"))?
.parse()?;
let addr_dest = std::env::args()
let addr_path = std::env::args()
.nth(3)
.ok_or(StrError::new("no src path"))?;
let addr_dest = std::env::args()
.nth(4)
.ok_or(StrError::new("no dest addr"))?;
let addr_dest_port: u16 = std::env::args()
.nth(4)
.nth(5)
.ok_or(StrError::new("no dest port"))?
.parse()?;
let should_tls: bool = std::env::args()
.nth(5)
.nth(6)
.ok_or(StrError::new("no should tls"))?
.parse()?;
@ -74,7 +78,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
};
let req = Request::builder()
.method("GET")
.uri("/")
.uri(addr_path)
.header("Host", &addr)
.header(UPGRADE, "websocket")
.header(CONNECTION, "upgrade")