Question

I am developing a proxy using Apache HTTP Components 4.

When a browser wants to open an SSL connection through my proxy it sends a request with the HTTP CONNECT method.

How can I implement the CONNECT method using HTTP Components? How can I turn the HTTP connection (which is already handled by the HTTP components library) into a raw TCP connection that is proxied through my program?

Était-ce utile?

La solution

Once a connection tunnel has been negotiated (CONNECT handshake has been successfully executed) and outgoing connection successfully established, your proxy should bypass the entire HTTP layer and start reading whatever stuff comes from the raw socket of the incoming connection and copying it to the raw socket of the outgoing connection, as well as reading whatever stuff comes form the socket of the outgoing connection and copying it to the socket of the incoming connection.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top