Leveraging Electron Proxy Support in Request Module

This is a open question. If you’ve an alternative approach that is feasible I’d be interested in hearing it.

I’m writing an Electron app based on an existing REST SDK. The SDK uses the requestjs module as the foundation for all network traffic. This has worked well so far. However now I need to add support for corporate proxies to my app. e.g. Basic, NTLM, Kerberos, Negotiate. It turns out that Electron supports these proxies very well via the net module.

I’d like to leverage this support as much as possible. e.g. To obtain the proxy settings and check if there is a need for authentication. This has worked and so far I’ve baked support for unauthenticated and basic proxies into the SDK. Mainly by using the HTTPS_PROXY environmental variable understood by the requestjs module.

However NTLM (and I assume Kerberos) is proving problematic. I thought I might be able to use the node-proxying-agent to support NTLM in the SDK (with Kerberos being a separate task to tackle later). But I can’t get this module working. I figure it lacks maturity and is a best effort release.

After coming to this conclusion I’ve started to look at creating my own http-agent. Namely with the end goal of seeing if I could get it to re-use the Electron net module. But I’m not sure how well this solution will pan out.

Have people any thoughts / previous experiences on this topic?