We still had issues with the new proxy setup event after we changed
our proxy agent implementation to use our own ProxyAgent.
As it turns out, it's because http and https modules would share
the same agent and when trying to make requests, the wrong protocol
might be used.
We now create 2 separate ProxyAgent instances and define the
protocol to use for each one so requests will always be sent with the
right one, even when computed in unexpected manners like when wrapped
by Sentry.
This however means that we need to provide the appropriate agent when
requests would not be made using the default http or https agent.
This is the case for WebSockets for example.
Please make sure the following boxes are checked:
[x] PR is not too big
[x] it improves UX & DX in some way
[ ] it includes unit tests matching the implementation changes
[x] it includes scenarios matching a new behaviour or has been manually tested
We still had issues with the new proxy setup event after we changed our proxy agent implementation to use our own
ProxyAgent
. As it turns out, it's becausehttp
andhttps
modules would share the same agent and when trying to make requests, the wrong protocol might be used.We now create 2 separate
ProxyAgent
instances and define the protocol to use for each one so requests will always be sent with the right one, even when computed in unexpected manners like when wrapped by Sentry.This however means that we need to provide the appropriate agent when requests would not be made using the default
http
orhttps
agent. This is the case forWebSocket
s for example.Please make sure the following boxes are checked: