IITB specific proxy setting for Node.js app

30 views
Skip to first unread message

fahim

unread,
Feb 11, 2016, 8:21:12 AM2/11/16
to Web and Coding Club IIT Bombay
Hi,

I am creating a simple Chat application where user can login through there Facebook account. I am using an Express framework in node.js and has tried out its basic proxy functionality. But I am not able to login through FB and its getting time out. I have already tried few solution from this website but with no result.

https://www.npmjs.com/package/express-http-proxy
http://stackoverflow.com/questions/20431697/node-http-proxy-and-express

I know the issue is due to proxy only as the same App is running without any error from outside the IITB network.

Please do let me know if anyone has solution for this scenario.

Regards,
Fahim

Pritam Baral

unread,
Feb 11, 2016, 8:53:54 AM2/11/16
to wncc...@googlegroups.com
Your problem has nothing to do with express-http-proxy, or any result to "node http proxy" you may normally find, for that matter.

Proxies are directional. The institute's proxy allows/routes connections to the outside, and is called a forward proxy. A middleware in node that proxies, routes connections bound into the web app itself, called a reverse proxy.

Coming to the real problem: Facebook's API should work through the standard ports insti allows: 80 and 443 (, as long you're logged into internet.iitb, of course). What are you using to login to Facebook? It's probably that library that is doing something non-standard. Tell us that, (and the output of `lsof -i -P | grep '^node' | grep -v LISTEN` – without the backquotes, of course).



#!/usr/bin/env regards
Chhatoi Pritam Baral

--
--
The website for the club is http://wncc-iitb.org/
To post to this group, send email to wncc...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "Web and Coding Club IIT Bombay" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wncc_iitb+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fahim Khan

unread,
Feb 12, 2016, 1:49:29 AM2/12/16
to wncc...@googlegroups.com
Hi Pritam,

I am using passport api to authenticate through Facebook.

The output of `lsof -i -P | grep '^node' | grep -v LISTEN` is 

node      3945 fahim   12u  IPv6  19392      0t0  TCP *:3000 (LISTEN)
node      3945 fahim   13u  IPv4  17399      0t0  TCP khan.local:21666->ec2-54-161-96-170.compute-1.amazonaws.com:39195 (SYN_SENT)
node      3945 fahim   14u  IPv4  21866      0t0  TCP khan.local:21667->ec2-54-161-96-170.compute-1.amazonaws.com:39195 (SYN_SENT)

Regards,
Fahim


Pritam Baral

unread,
Feb 12, 2016, 9:24:16 PM2/12/16
to wncc...@googlegroups.com

FAQ: Insti outgoing ports
A: HTTP on 80 and anything on 443, when logged in at internet.iitb. Anything on 22, always. Any port with HTTP on it via netmon. Anything on 8443 via CONNECT tunneling via netmon.


@Fahim:

1. Those are not connection attempts to facebook. I'm guessing those are connection attempts to your private server.

2. Don't use destination ports other than 80 and 443 if you want to be able to connect from within the institute. I strongly doubt you're doing anything but HTTP(S) (and if you're doing HTTP, then you should be doing HTTPS. It's free.) on that port 39195, so why not use the standard port 443 for that?

Fahim Khan

unread,
Feb 13, 2016, 12:10:07 AM2/13/16
to wncc...@googlegroups.com
Thanks Pritam. I will try it out.
Reply all
Reply to author
Forward
0 new messages