问题
Is it right that HTTPProxyHandler always sends a CONNECT request? Isn't this only applicable when you want to do tunneling?
回答1:
HTTPProxyHandler
does not know if you only want to tunnel http data, or want to make http request at the moment of connection, therefore, it guesses the option that works in both cases, since a standard complements HTTP proxy supports both the CONNECT and the old http proxy method call. If you need to implement a HTTP proxy using GET and other methods, just thread the connection as a normal HTTP connection, but specify the full url including the http://
part in the url.
来源:https://stackoverflow.com/questions/29446945/netty-httpproxyhandler-always-sends-a-connect