Accessing webservices from a website which is running behind a proxy Accessing webservices from a website which is running behind a proxy node.js node.js

Accessing webservices from a website which is running behind a proxy


Usually you need to do both of these :

npm config set proxy your-proxy-address:portnpm config set registry "http://registry.npmjs.org/"


In general I suggest you try to get this problem solved by isolating the issue more.

There are still too many open variables. Does your request really travels through the proxy or does it die in the proxy? If it leaves the proxy - why not build just [Proxy] -> Server2?

I have a gut feeling that the issue is somewhere in the (missing) headers that the proxy forwards. This "NetworkError: 500" is - for example - created by PHP-servers when the process dies while sending output. Maybe you trigger a bug in Server2, because your proxy output is different to Server1-output?

Just compare the output of the Proxy against the output of Server1 (nc is your friend). Hope this helps.


If Sun Tzu was on this thread, he'd tell you the correct strategy would not to be in this position in the first place. As port 443 is usually open on all corporate networks, to allow https traffic consider creating a server using (someone's) cloud offering somewhere and ssh'ing to it on port 443. You could even use this technique to create your own proxy for development purposes (see squidd) - that way at least you could at least see the proxy logs.

You are trying to solve two problems at once - one is networking the other is the code you are writing. Doing this would mean you only have to solve one at a time, and neither is blocking your progress.