Closed
Description
Since #98 removed the request library in favour of the stock Node HTTP implementation, the Optimizely SDK no longer supports HTTP(S) Proxies, as Node does not proxy by default (as documented here nodejs/node#15620).
We host our feature branches on a PAAS that requires outbound HTTP connections be proxied: As a result this bug currently causes our application to crash with the error below when calling optimizely.activate
2018-06-21T16:49:56.60+0100 [APP/PROC/WEB/0] ERR events.js:183
2018-06-21T16:49:56.60+0100 [APP/PROC/WEB/0] ERR throw er; // Unhandled 'error' event
2018-06-21T16:49:56.60+0100 [APP/PROC/WEB/0] ERR ^
2018-06-21T16:49:56.60+0100 [APP/PROC/WEB/0] ERR Error: connect ECONNREFUSED 34.228.76.60:443
2018-06-21T16:49:56.60+0100 [APP/PROC/WEB/0] ERR at Object._errnoException (util.js:1022:11)
2018-06-21T16:49:56.60+0100 [APP/PROC/WEB/0] ERR at _exceptionWithHostPort (util.js:1044:20)
2018-06-21T16:49:56.60+0100 [APP/PROC/WEB/0] ERR at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
This error can't be caught, because it occurs asynchronously to the main control flow of the application, and thus causes the entire application server to crash.