Http.Client behind corporat proxy

Sett 1 475 ganger
Hopp til første uleste melding

florin

ulest,
22. juni 2010, 08:57:1022.06.2010
til 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

ulest,
22. juni 2010, 15:27:4322.06.2010
til 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

ulest,
23. juni 2010, 03:25:3923.06.2010
til nod...@googlegroups.com
Check out connect-proxy(1), it can tunnel outbound requests through
HTTP and SOCKS proxies.

florin

ulest,
23. juni 2010, 03:35:5523.06.2010
til 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

ulest,
23. juni 2010, 03:45:5323.06.2010
til 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

ulest,
23. juni 2010, 03:51:3923.06.2010
til 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

ulest,
23. juni 2010, 04:02:4223.06.2010
til nod...@googlegroups.com

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

florin

ulest,
24. juni 2010, 04:03:5724.06.2010
til 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

ulest,
24. juni 2010, 04:14:2124.06.2010
til 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

ulest,
24. juni 2010, 04:22:2024.06.2010
til nodejs
connect-proxy is only for SOCKS proxies. I gave it a shot with our
corp proxy, no go.

Ben Noordhuis

ulest,
24. juni 2010, 05:47:2324.06.2010
til 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

ulest,
25. juni 2010, 08:11:3525.06.2010
til 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
Svar alle
Svar til forfatter
Videresend
0 nye meldinger