TooTallNate / proxy-agents

Node.js HTTP Proxy Agents Monorepo
https://proxy-agents.n8.io
917 stars 238 forks source link

Reading headers from the Response for HTTP Connect method to the Proxy Server #309

Closed sergzak022 closed 5 months ago

sergzak022 commented 5 months ago

Hello,

When I send a request through a proxy server using curl with --verbose option it also prints headers that come from the Response for HTTP Connect method to the Proxy Server. Does HttpsProxyAgent provides a way to read these headers?

Just to clarify, I'm not interested in headers from the target server, but interested in headers from the Proxy Server.

Thank you!

TooTallNate commented 5 months ago

You can listen for the "proxyConnect" event on either the Request instance or the Agent instance.