Hi
hyper crate version 0.13
let req = Request::connect(uri)
.body(Body::empty())
.unwrap();
let client = Client::builder().build(HttpConnector::new()));
let resp = match client.request(req).await {
Err(e) => {
let msg = format!("HTTP tunnel cannot be established. {}", e);
error!("{}", &msg);
return Err(io::Error::new(io::ErrorKind::NotConnected, msg));
},
Ok(resp) => resp
};
if resp.status() != StatusCode::OK {
let msg = format!("CONNECT {} responsed HTTP {}", uri, resp.status());
error!("{}", &msg);
return Err(io::Error::new(io::ErrorKind::PermissionDenied, msg));
}
// now HTTP tunnel is established, how can I read/write to tcp stream in resp?
Thank you