When replacing electron-proxy-agent with our custom implementation
of a proxy agent, we replaced the globalAgent of both http and
https modules but left http.Agent.globalAgent untouched.
Unfortunately, this prevented our WebSockets to connect when the
Sentry SDK was setup as its wrapper over http.request would make
changes to the protocol being used to make the connection.
It seems that the protocol used was the one of
http.Agent.globalAgent so replacing this agent again fixes the
issue.
This also allows us to stop passing a custom agent to the WebSocket
constructor and thus simplify the use of cozy-realtime.
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
When replacing
electron-proxy-agent
with our custom implementation of a proxy agent, we replaced theglobalAgent
of bothhttp
andhttps
modules but lefthttp.Agent.globalAgent
untouched.Unfortunately, this prevented our
WebSocket
s to connect when the Sentry SDK was setup as its wrapper overhttp.request
would make changes to the protocol being used to make the connection.It seems that the protocol used was the one of
http.Agent.globalAgent
so replacing this agent again fixes the issue. This also allows us to stop passing a custom agent to theWebSocket
constructor and thus simplify the use ofcozy-realtime
.Please make sure the following boxes are checked: