mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-13 14:30:02 -04:00
Procedual GET Arg
This commit is contained in:
parent
8b2a8a3eb3
commit
b6c35cfdf2
1 changed files with 9 additions and 4 deletions
|
@ -52,16 +52,21 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
.ok_or(StrError::new("no src port"))?
|
.ok_or(StrError::new("no src port"))?
|
||||||
.parse()?;
|
.parse()?;
|
||||||
|
|
||||||
let addr_dest = std::env::args()
|
let addr_path= std::env::args()
|
||||||
.nth(3)
|
.nth(3)
|
||||||
|
.ok_or(StrError::new("no src path"))?;
|
||||||
|
|
||||||
|
|
||||||
|
let addr_dest = std::env::args()
|
||||||
|
.nth(4)
|
||||||
.ok_or(StrError::new("no dest addr"))?;
|
.ok_or(StrError::new("no dest addr"))?;
|
||||||
|
|
||||||
let addr_dest_port: u16 = std::env::args()
|
let addr_dest_port: u16 = std::env::args()
|
||||||
.nth(4)
|
.nth(5)
|
||||||
.ok_or(StrError::new("no dest port"))?
|
.ok_or(StrError::new("no dest port"))?
|
||||||
.parse()?;
|
.parse()?;
|
||||||
let should_tls: bool = std::env::args()
|
let should_tls: bool = std::env::args()
|
||||||
.nth(5)
|
.nth(6)
|
||||||
.ok_or(StrError::new("no should tls"))?
|
.ok_or(StrError::new("no should tls"))?
|
||||||
.parse()?;
|
.parse()?;
|
||||||
|
|
||||||
|
@ -74,7 +79,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
};
|
};
|
||||||
let req = Request::builder()
|
let req = Request::builder()
|
||||||
.method("GET")
|
.method("GET")
|
||||||
.uri(format!("wss://{}:{}/", &addr, addr_port))
|
.uri(addr_path)
|
||||||
.header("Host", &addr)
|
.header("Host", &addr)
|
||||||
.header(UPGRADE, "websocket")
|
.header(UPGRADE, "websocket")
|
||||||
.header(CONNECTION, "upgrade")
|
.header(CONNECTION, "upgrade")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue