-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Hello!
I have the unfortunate challenge of trying to get an application working in a corporate/government type environment where all traffic is behind a firewall that decrypts/encrypts traffic to the outside world. The general way we get around that is that in the browser, the browser itself handles the SSL proxy problem, but when running node (in electron, for example) we need to manually say "hey node, use this certificate authority". Example:
https.globalAgent.options.ca = myListOfCerts;
This sets it so that all normal XHR calls to the outside world running in nodejs use this trusted list of certs.
Sockjs, however, is ignoring the global agent (i'm sure for good reason) when making the initial XHR request to the outside world before upgrading to the wss connection. This ignores the global ca option, and sockjs does not currently provide a way to pass through "xhrOptions" or whatever we would like to call them so that we can manually set them.
I'd like to propose allowing xhrOptions to be passed in. I have forked the project for my own purposes, but think it would be a great feature and would be happy to set that PR up if this idea is well received.
Thanks!