Add HTTP client proxy support
zcourts opened this issue · 2 comments
zcourts commented
Implement proxy support such that GET and POST requests directly write request contents to the proxy when using http without the upgrade header.
For any other HTTP method i.e. PUT, DELETE or when using SSL or WebSocket proxy using the HTTP connect method, ala HTTP tunneling.
Regardless of the proxy method, add support for HTTP Basic authentication.
Note to self: Remember to use keep alive with:
Proxy-Connection: keep-alive
Connection: keep-alive
for web sockets
RFCs:
Upgrading to TLS
http://tools.ietf.org/html/rfc2817#section-5.2 in HTTP 1.1
HTTP 1.1 spec
http://tools.ietf.org/html/rfc2068#section-8.1.3
zcourts commented
Pseudo logic
If proxy enabled
if !SSL and (GET or POST)
connect to proxy host:port and write HTTP request with Proxy-Authorization [if provided]
else
connect to proxy host:port
write HTTP connect request with Proxy-Authorization [if provided]
write original request to established TCP stream for the proxy to forward
end if
end if
zcourts commented
added in 0.0.7
Latest version at http://search.maven.org/#browse%7C-819925117