Open indrek-sixfold opened 6 months ago
Hi, @indrek-sixfold! Thanks for reporting this.
At the first glance, the issue is happening because the request-making module (http
or https
) is bound to the initial request when using Interceptors. I assume during proxying, since you are switching protocols, the interceptor attempts to perform the proxied request using the wrong request module for some reason.
In theory, that shouldn't happen because the request originates from proxy-agent
, we aren't constructing them internally (unless the request is bypassed, which I believe is precisely your use case).
We need an integration test for this.
This bug is still there.
@justemu, would you like to give it a try? I can support you with code review and merge your fix once it's ready. Let me know!
When using ClientRequestInterceptor with ProxyAgent, it ends with error
Code is here:
Using packages:
Is there anything to configure to make it work with proxy?