Struggling to make it work behind corporate firewall.

405 views
Skip to first unread message

Dinesh Rampal

unread,
Jun 22, 2016, 8:50:40 AM6/22/16
to nodejs
Hi

I have a application which works fine, but when i try to make it work in office behind a corporate firewall, it fails to make a call to a internet cloud based database. Querying in Google, i found that i need to set up config parameters - proxy and https-proxy.

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

I have done the above commands in all possible combinations, but it doesn't work.

Can somebody tell me how can i come around this problem ? Is this the only way to solve this OR there are solutions to my issue.

The exception which i get is -  
            event.js : 85
            
            throw er; // Unhandled 'er' event.

            Error : connect ETIMEDOUT

                         at exports._ErrnoExcpetion <util.js:746:11>
                          at TCPConnectWrap.afterConnect [as Oncomplete] <net.js:1010:19>

My project is at stake.

Will appreciate all help.

thanks a lot

regards
dinesh





Stefan Klein

unread,
Jun 23, 2016, 7:57:30 PM6/23/16
to nod...@googlegroups.com
Hi

2016-06-22 14:49 GMT+02:00 Dinesh Rampal <rampaldi...@gmail.com>:
Hi

I have a application which works fine, but when i try to make it work in office behind a corporate firewall, it fails to make a call to a internet cloud based database. Querying in Google, i found that i need to set up config parameters - proxy and https-proxy.

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

I have done the above commands in all possible combinations, but it doesn't work.

Can somebody tell me how can i come around this problem ? Is this the only way to solve this OR there are solutions to my issue.

(assuming you're using some variant of *nix)

Can't directly help with npm, but "npm help 7 config" states, npm would honor http_proxy environment variables.
So I would leave npm config alone (at least for the moment) and setup the environment variables, it should be much easier to debug those using "curl -v <same npm api url>"

regards,
Stefan

Nathan Rajlich

unread,
Jun 23, 2016, 8:08:27 PM6/23/16
to nodejs
npm config settings are only used by the npm cli client. Are you trying to invoke npm or your own node.js code?

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/d603b86e-a335-4bb4-b76d-be62faea4c82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Denard Springle

unread,
Jun 23, 2016, 8:08:43 PM6/23/16
to nodejs
Hey Dinesh,

   If you're behind a corporate firewall then proxy will not help you as you will still be unable to establish an http connection with the proxy from behind the firewall (which is blocking your outside access). Also, since you're trying to connect to a database, a proxy will not help you because it's an http proxy, not a tcp proxy and (most) database connections don't (typically) use http. 

   The solution is to adjust the corporate firewall to allow your server access to the internet, in general, or at least to the cloud based database port, if nothing else.

   In short, this is a dev ops or IT issue and needs to be resolved by whomever handles managing the firewall for your corporation.

HTH!

-- Denny

Dinesh Rampal

unread,
Jun 24, 2016, 3:57:08 AM6/24/16
to nodejs
One more thing, we have NTLM proxy deployed in our organisation.

thanks
dinesh

Dinesh Rampal

unread,
Jun 24, 2016, 3:57:16 AM6/24/16
to nodejs
Hey Denard
  I made a mistake in my text. Actually I am behind corporate proxy ...i wrongly wrote corporate firewall! Apologoies.
   Does your reply still hold true for Corporate proxy also OR there is a way i can make it work if my request is originating from behind a corporate proxy ?


On Friday, June 24, 2016 at 5:38:43 AM UTC+5:30, Denard Springle wrote:

Denard Springle

unread,
Jun 24, 2016, 10:15:55 AM6/24/16
to nodejs
Hey Dinesh,

   Couple of things...

   First, you really aren't providing us with enough information to be helpful. 

   Second, it seems that you lack a basic understanding of networking and protocols at this juncture, so explaining how you might fix a problem I can only guess at to someone without a lot of network knowledge might be difficult... so forgive me if you get lost in this response or if it simply doesn't apply to your situation.

   If you are connecting to a database in the cloud... my first question would be why are you not also running you application in the cloud, preferably on the same subnet as the cloud database? In all honesty, this would be how I would handle this situation and avoid the proxy issues altogether, as well as the latency (and thus performance) issues associated with the configuration you describe

   Assuming you have some pressing reason to run your code behind a proxy and your database in the cloud, and assuming you're connecting to a standard TCP port to talk to your database on the cloud, and assuming you're using socket() based methods to access it, and assuming your corporate proxy is a SOCKS proxy, then...


   Might do the trick. I haven't used it so can't vouch for it, and it doesn't provide any TCP specific examples (just HTTP/HTTPS) but a quick read of the docs suggests it will work for any TCP port, so... it might be worth a shot. I'd do a small test program with it first to make sure it works with your proxy and your database calls before I invested any time in rewriting how your actual application works.

   Again, not knowing your application configuration, your corporate network's configuration, your cloud database configuration, etc. I'm just taking stabs in the dark here. 

   The simplest answer, however, is to run the application in the cloud with the database.

-- Denny

Dinesh Rampal

unread,
Jun 25, 2016, 9:27:58 AM6/25/16
to nodejs
Hi Denny,
Thanks for your patience and response. Will definitely try that and revert either way.
The only reason I need to write this script on a on-premise server (behind corporate proxy) is that I am building a bidirectional data exchange interface between the cloud database and SAP, which is hosted on data centres inside our office (not exposed on public internet).
I couldn't think of a better idea. Are there better ideas to solve my task. What's your opinion?

Thanks and regards
Dinesh

Denard Springle

unread,
Jun 25, 2016, 12:56:41 PM6/25/16
to nodejs
Hey Dinesh,

   Does the database need to be in the cloud? I assume you're doing it that way to make some SAP data publicly accessible, but if this is just an internal thing then I'd simply move the database on-premise as well.

   If you are doing it to expose some SAP data publicly, or otherwise offer an interface for customers to access, add, update, etc. data that comes from/goes into SAP then I'd break the app up into two pieces:

1. The public facing MVC site with all the HTML, etc. needed for customers to engage with the data, and a REST API for data transfer

2. The private (on-premise) app that connects to SAP and the REST API of your public app for data transfer - you'll still have to use an HTTP proxy client in your code for making the connections, but they'd be all HTTP calls instead of trying to talk to the database port directly - which should be easier to do (and there are a plethora of HTTP proxy modules available for Node, including the one I'd already linked).

   Having said that... let us circle back to the firewall for a second. If you are unable to make any TCP calls to the database from inside the premise, then there has to be a firewall somewhere on-premise preventing that network traffic. While a proxy might be used to allow HTTP calls out through the firewall, there still has to be a firewall involved to block all TCP traffic (proxies don't do that by themselves). So, I once again repeat my first notion that you should speak with your IT team and ask them to add a rule to allow your specific on-premise server to make TCP calls out to your specific cloud server and port. 

HTH!

Denny

   
Reply all
Reply to author
Forward
0 new messages