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

SessionPooling #459

Closed
SteveSelva opened this issue Aug 2, 2023 · 1 comment
Closed

SessionPooling #459

SteveSelva opened this issue Aug 2, 2023 · 1 comment

Comments

@SteveSelva
Copy link

I am creating a HTTPS Forward Proxy Server using the example given in Proxygen's proxygen-proxy Project. I have modified some changes to make it work as I want.

The code flow of the HTTPS Forward Proxy Server is mentioned below:

HTTPServer is listening for connections on port X.
AcceptorFactory is initialized with a SessionPool which is common for the whole proxy.
AcceptorFactory creates HTTPServerAcceptor according to number of threads present in PC.
While creating instances of HTTPServerAcceptor, SessionPool object is being shared as pointers.
When connection is accepted it is processed in HTTPServerAcceptor.
HTTPServerAcceptor establishes the downstream connection.
While creating a downstream session, it asks for a RequestHandler.
HTTPServerAcceptor creates a RequestHandler with SessionPool's pointer and sends it to Downstream Session.
Then the Request in sent to RequestHandler.
RequestHandler checks the SessionPool whether already a session is available for the Upstream session, if present uses the session, if not it establishes an upstream connection and creates an Upstream Session and the created UpstreamSession is stored in that SessionPool.
In this flow, I implemented SessionPool at AcceptorFactory and sending that SessionPool's pointer to HTTPServerAcceptor and RequestHandler thereby a common SessionPool is utilized by the whole proxy making it efficient.

Is this approach correct?

Note: ProxyServer is working in TLS 1.3 HTTP/2 Protocol as Forward Proxy.

@ryoshou
Copy link

ryoshou commented Jun 7, 2024

Please let me know your approach so far. Do you solve your issues and how you implement SessionPool?

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

2 participants