-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Dear developers, hello!
Is your feature request related to a problem? Please describe.
I want to use hyper on an existing stream (may be DuplexStream), and I expect some methods to solve this problem. In my case, only HTTP/1.1 is considered.
Describe the solution you'd like
Actually I copied and adapted some lines from hyper-rustls. I made my own HttpsConnector:
let (mut client, mut server) = tokio::io::duplex(64);
let connector = MyHttpsConnector::new(KiteTlsStream::new(client));
let client: hyper::Client<_, hyper::Body> = hyper::Client::builder()
.build(connector);As DuplexStream can not be cloned, my solution failed.
Describe alternatives you've considered
In this way, hyper will be used as a HTTP request generator and response parser. So I wonder that can hyper be used as a pure convertor?
Additional context
This may happen very rarely: I have a client and server (this program), and a web server (named A). The client and the server communicate by gRPC. The server cannot access A directly while the client can. In order to make server to be able to request A for data, I need the client to relay TLS packets to keep communication details private.
gRPC streaming socket
Server ---------------- Client ------- Web server (A)
steps:
- client starts a connection to server using gRPC.
- client streams some data to server.
- server makes request to web server by gRPC streaming
- ...
- done
emmmm...What should I do? Thank you!