My app uses require(‘http’) to download files in the background while the chrome-based UI is presented to the user. If the user has a proxy server set up globally on their machine (for example, on a Mac in System Preferences > Network > Advanced… > Proxy if they have the URL of a .pac file set up), the browser part just works. Chrome detects the system proxy and uses it. But my http downloads don’t.
Is there any way to convince node’s http or https modules to obey the global system proxy settings? I’ve googled like crazy and I can’t find any solution.
(I found app.commandLine.appendSwitch(‘proxy-pac-url’, ‘http://blah-blah-blah/pac.pac’) but that only changes the browser, it doesn’t impact the node stuff; and I don’t need that since the browser is using the system settings correctly anyway.)