Proxy dropping custom headers with https

Problem :

With HTTPS requests my proxy is dropping custom headers from the response :

HTTP request :

$ curl -I -x 127.0.0.1:5566 http://www.google.fr
HTTP/1.1 200 OK
...
X-Servedby: 50001 => My custom header is added to the response

full response : https://gist.github.com/vdaubry/eafabf211957cbe87563

HTTPS request :

$ curl -I -x 127.0.0.1:5566 https://www.google.fr
HTTP/1.1 200 Connection established
Proxy-Agent: Privoxy/3.0.23
X-Servedby: 50001 => doesn't appear in the final response

HTTP/1.1 200 OK
Date: Sat, 07 Feb 2015 16:29:25 GMT
...
Vary: Accept-Encoding

full response : https://gist.github.com/vdaubry/2869d85b2e8affdc5a8c

I don't understand why the custom header is added when the connection opens but is not to the final response ?


More infos :

I have HAProxy load balancing requests to multiple Privoxy instances. HAProxy is adding the privoxy instance name to the response in a custom header "X-Servedby" (like this : How to get name of server that has served request in fronted section?)

It works well with HTPP request but custom headers are dropped with HTTPS requests

Privoxy is set as a transparent proxy (accept-intercepted-requests=1). In the doc it says

Note that intercepting encrypted connections (HTTPS) isn't supported.

Not sure that's related to the problem ?


If i'm reading this right, you've identified the problem. Your real question seems to be "Header not ADDED when using HTTPS" - is that correct? The proxy is responsible for inserting the header?

If that's the case, it can't be done without intercepting HTTPS as all bar one of the headers (host) are encrypted.