Class HttpTunnel.HttpTunnelConnection
java.lang.Object
jodd.http.HttpTunnel.HttpTunnelConnection
- All Implemented Interfaces:
Runnable
- Enclosing class:
HttpTunnel
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidonRequest(HttpRequest request) Invoked after income connection is parsed.protected voidonResponse(HttpResponse response) Invoked after target response is processed.voidrun()protected voidtunnel()Performs the tunneling.
-
Field Details
-
socket
-
-
Constructor Details
-
HttpTunnelConnection
-
-
Method Details
-
run
-
onRequest
Invoked after income connection is parsed. Nothing is changed in the request, except the target host and port. -
onResponse
Invoked after target response is processed. Response is now ready to be sent back to the client. The following header parameters are changed:- Transfer-Encoding is removed, as body is returned at once,
- Content-Length is added/update to body size.
-
tunnel
Performs the tunneling. The following steps occurs:- read and parse clients request
- open socket to target
- resend request to target
- read targets response
- fix response and resend it to client
- Throws:
IOException
-