hpagent icon indicating copy to clipboard operation
hpagent copied to clipboard

Allow client to push custom headers in connect request

Open kamilikamil opened this issue 4 years ago • 1 comments

I think it would be nice to allow the client to pass custom headers which are then sent to proxies in the connect request

kamilikamil avatar Sep 16 '20 20:09 kamilikamil

I know this is an old, stale PR, but I recommend closing it. Typically, you should not blindly send headers intended for the upstream server in the proxy CONNECT request. Some headers may include sensitive information and need to be sent only over an encrypted connection, such as Authorization - not to mention that the proxy itself has no use for that header. Other headers can cause interference, like including the Content-Type and Content-Length headers from the upstream request with the CONNECT request.

Instead I would recommend looking at PR #72, which adds support for explicitly setting request options specifically for the CONNECT request; that includes passing custom headers to the proxy server without including them in the upstream request (and vice versa).

mbargiel avatar May 22 '22 17:05 mbargiel