Archive for the 'node.js' Category

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

Tuesday, December 20th, 2011

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 [...]