Closed surlyhacker closed 1 year ago
Interesting question, did you find a solution for this?
Thanks!
Well one way I just tried is to debug into the source, and it appears to capture these headers here:
https://github.com/TooTallNate/node-https-proxy-agent/blob/master/src/parse-proxy-response.ts#L53
And then returns them internally in a Promise here:
https://github.com/TooTallNate/node-https-proxy-agent/blob/master/src/agent.ts#L131
So that buffered
variable holds the headers returned by the proxy server after CONNECT is issued.
Would be really nice if this was exposed via an API and/or callback event.
Ah, thanks.
Yes, or adding them in final response headers like most of the proxies do.
Well if the proxy itself adds headers (to responses from the target host), then those would show up and be accessible like any other response headers and pass right through this agent. But in my case I am using a proxy that does not do that, and passed some important headers only in its own CONNECT response.
This module has gone through a large refactor and modernization. I am closing this issue as a bit of house cleaning. If you feel that this issue still exists in the latest release, feel free to open a new issue.
Reopened as #153
Hi,
Is there a way to get the response headers that are sent back to the client by the proxy in response to the CONNECT method? Typically these headers return metadata associated with the proxy itself and how it may be acting. These are distinct of course from response headers to the actual proxied request issued subsequent to the CONNECT.
Thanks