You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically you should mix server + client example into one async request.
On a CONNECT server request, you create a client CONNECT request to the remote proxy. If that suceeds (OK in client response), you send OK in the server response. Then you upgrade server request and client response to get both raw connections. Then you pipe everything through in both directions (here is an example for that: https://github.com/tokio-rs/tokio/blob/599955f/tokio/examples/proxy.rs#L68).
After reading https://medium.com/@mlowicki/http-s-proxy-in-golang-in-less-than-100-lines-of-code-6a51c2f2c38c, the idea was born to write a proxy server on rust.
In https://github.com/hyperium/hyper/blob/master/examples/README.md is written that the example https://github.com/hyperium/hyper/blob/master/examples/upgrades.rs can help.
But I do not really understand how this can be done. I think it would be great to write an example of how to redirect CONNECT requests.
The text was updated successfully, but these errors were encountered: