Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward Proxy #458

Closed
SteveSelva opened this issue Aug 1, 2023 · 0 comments
Closed

Forward Proxy #458

SteveSelva opened this issue Aug 1, 2023 · 0 comments

Comments

@SteveSelva
Copy link

I am making a Forward HTTPS Proxy Server using Proxygen.

When I analyzed the code, I came to know that HTTPSession is first created over the socket with HTTP version and TLS details wrapped in it.
With that session, for each request, a HTTPTransaction is created and handled by the RequestHandler.
RequestHandler acts as a downstream manager and ResponseHandler acts as a upstream manager.
After the request is completed, the transaction is deleted. After a certain period, if no transactions remain in the session, session also gets destroyed based on idleTimeout or HTTP Protocol.

In Forward HTTPS Proxy,
Every connection starts with CONNECT Request with HTTP/1.1 and without TLS.
The CONNECT request received from the downstream should be and forwarded to upstream.
But the handling of both downstream and upstream are different.

In Downstream, for CONNECT Request, Connection Established with 200 Response Code should be sent and TLSHandshake should be done(waiting for ClientHello message from Downstream). And TLS connection should be established.

In Upstream, CONNECT Request should be forwarded from the server, and the upstream should wait until Connection Established Message with 200 Response Code is return and then TLSHandshake should be done(send ClientHello message to Upstream). And TLS connection should be established.

When both sides(downstream and upstream) have established TLS connections, the proxy would function normally, like forwarding the request from downstream to upstream and then forwarding the response from upstream to downstream.

How to configure Proxygen to work as Forward HTTPS Proxy Server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant