keithwhor / nodal

API Services Made Easy With Node.js
http://www.nodaljs.com/
MIT License
4.51k stars 209 forks source link

Can't use Nodal behind corporate proxy #282

Open beders opened 8 years ago

beders commented 8 years ago

I tried to use nodal poly:login behind a corporate proxy and was unable to connect. I've set various env variables (HTTP_PROXY, http_proxy, HTTPS_PROXY, https_proxy).

keithwhor commented 8 years ago

That's not good, what's the error you're getting? What corporation? If you e-mail me specifically (keith at polybit) I can get some more information from you and we might be able to solve this a little faster.

beders commented 8 years ago

The core issue lies with https://github.com/keithwhor/api-res/blob/master/module.js which uses the raw http library which doesn't care about proxy settings.

Consider using the request package instead for your HTTP requests. It will automatically pick up any proxy-specific environment variables.

niallobrien commented 8 years ago

@beders I had a similar issue when trying to use npm and no matter what I tried, I couldn't get it to work behind a corporate proxy. Eventually I installed Fiddler, set my env vars to use Fiddler as a proxy and it all works great. I'm not sure if it will help you in this particular scenario, but it's worth a shot.

For example, here's my .npmrc: registry=https://registry.npmjs.org proxy=http://127.0.0.1:8888 https-proxy=http://127.0.0.1:8888 http-proxy=http://127.0.0.1:8888 strict-ssl=false