Http.Client behind corporat proxy

1,470 views
Skip to first unread message

florin

unread,
Jun 22, 2010, 8:57:10 AM6/22/10
to nodejs
Hi,
I am running nodejs behind a firewall and I am trying to issue an
outbound request when a client hits a certain URL on the running
nodejs (say, to http://search.twitter.com). The problem is that I'm in
a corporate environment and there's a proxy server that facilitates
internet access. As a result, HttpClient.request times-out.
I am wondering if it is possible to configure node for proxy access.
Start-up parameters would be great (curl/wget style)...

Any ideas?
florin

Chris Winberry

unread,
Jun 22, 2010, 3:27:43 PM6/22/10
to nod...@googlegroups.com

Is it a SOCKS or HTTP proxy?


--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.

Ben Noordhuis

unread,
Jun 23, 2010, 3:25:39 AM6/23/10
to nod...@googlegroups.com
Check out connect-proxy(1), it can tunnel outbound requests through
HTTP and SOCKS proxies.

florin

unread,
Jun 23, 2010, 3:35:55 AM6/23/10
to nodejs
It's HTTP proxy.

On Jun 22, 9:27 pm, Chris Winberry <cpt.obvi...@gmail.com> wrote:
> Is it a SOCKS or HTTP proxy?
>
> On Jun 22, 2010 3:21 PM, "florin" <dur...@gmail.com> wrote:
>
> Hi,
> I am running nodejs behind a firewall and I am trying to issue an
> outbound request when a client hits a certain URL on the running
> nodejs (say, tohttp://search.twitter.com). The problem is that I'm in
> a corporate environment and there's a proxy server that facilitates
> internet access. As a result, HttpClient.request times-out.
> I am wondering if it is possible to configure node for proxy access.
> Start-up parameters would be great (curl/wget style)...
>
> Any ideas?
> florin
>
> --
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com.
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com <nodejs%2Bunsu...@googlegroups.com>.

r...@tinyclouds.org

unread,
Jun 23, 2010, 3:45:53 AM6/23/10
to nod...@googlegroups.com
On Wed, Jun 23, 2010 at 12:35 AM, florin <dur...@gmail.com> wrote:
> It's HTTP proxy.

If I understand forward HTTP proxies correctly - it requires the
CONNECT method open a tunnel?

Ben Noordhuis

unread,
Jun 23, 2010, 3:51:39 AM6/23/10
to nod...@googlegroups.com
On Wed, Jun 23, 2010 at 09:45, <r...@tinyclouds.org> wrote:
> If I understand forward HTTP proxies correctly - it requires the
> CONNECT method open a tunnel?

Yes, but not all HTTP proxies support it (or have it locked down, you
can use it to e.g. tunnel SSH traffic). The simplest proxy call is
something like:

GET http://search.twitter.com/ HTTP/1.0
Host: search.twitter.com

r...@tinyclouds.org

unread,
Jun 23, 2010, 4:02:42 AM6/23/10
to nod...@googlegroups.com

So, the simple case should work. The tunneling, I think does not.

florin

unread,
Jun 24, 2010, 4:03:57 AM6/24/10
to nodejs
Well, that's unfortunate since it makes it hard (impossible?) to test
nodejs when you're behind corp proxies...

On Jun 23, 10:02 am, r...@tinyclouds.org wrote:

Ben Noordhuis

unread,
Jun 24, 2010, 4:14:21 AM6/24/10
to nod...@googlegroups.com
On Thu, Jun 24, 2010 at 10:03, florin <dur...@gmail.com> wrote:
> Well, that's unfortunate since it makes it hard (impossible?) to test
> nodejs when you're behind corp proxies...

Have you read up on connect-proxy?

florin

unread,
Jun 24, 2010, 4:22:20 AM6/24/10
to nodejs
connect-proxy is only for SOCKS proxies. I gave it a shot with our
corp proxy, no go.

Ben Noordhuis

unread,
Jun 24, 2010, 5:47:23 AM6/24/10
to nod...@googlegroups.com
On Thu, Jun 24, 2010 at 10:22, florin <dur...@gmail.com> wrote:
> connect-proxy is only for SOCKS proxies. I gave it a shot with our
> corp proxy, no go.

My copy from the Ubuntu repositories supports HTTP just fine. I'd
suggest you update yours but I think connect-proxy hasn't been updated
since 2006.

$ HTTP_PROXY_PASSWORD=password connect-proxy -H
us...@proxy.corp.com:8080 -p 1337 example.com 80

Alternatively, you could use proxychains. It's slightly more work to
set up but then you can just do:

$ proxychains /path/to/node application.js

And everything will transparently be proxied.

florin

unread,
Jun 25, 2010, 8:11:35 AM6/25/10
to nodejs
proxychains did the trick, thanks Ben!!


On Jun 24, 11:47 am, Ben Noordhuis <i...@bnoordhuis.nl> wrote:
> On Thu, Jun 24, 2010 at 10:22, florin <dur...@gmail.com> wrote:
> > connect-proxy is only for SOCKS proxies. I gave it a shot with our
> > corp proxy, no go.
>
> My copy from the Ubuntu repositories supports HTTP just fine. I'd
> suggest you update yours but I think connect-proxy hasn't been updated
> since 2006.
>
> $ HTTP_PROXY_PASSWORD=password connect-proxy -H
> u...@proxy.corp.com:8080 -p 1337 example.com 80
Reply all
Reply to author
Forward
0 new messages