Can’t do http.request? Are you behind the proxy?

If that’s the case then instead of:

http.get({
    host: "www.google.com",
    path: "/",
    port: 80,
    method: "GET"
  }, function(res) {
  ...
});

do:

http.get({
    host: "proxy.url.com", // <- no protocol
    path: "http://www.google.com/#sclient=psy-ab&hl=en&safe=off&q=node.js&pbx=1",
    port: 8080, // <- your proxy port
    method: "GET",
    headers: {
      Host: "www.google.com"
    }
  }, function(res2) {
  ...
});

This will send your request via your proxy server.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>