I implemented a forward proxy in the node-foreman module, and I ran into a
problem with what req.url was returning. Sometimes it would be a path,
other times a full url.

See here
(https://github.com/NodeFly/node-foreman/blob/master/forward.js)

I used the proxy to test my Github OAuth login. The proxy would intercept
requests to my production URL and point them instead to the local
application. This was handy because OAuth gives the browser a callback URL,
so either you need a dev/prod OAuth key, or you need to edit your hosts
file constantly.

On Thu, Nov 22, 2012 at 5:51 AM, Mk <[email protected]> wrote:

> hi,
> i have this code:
>
> var http = require('http');
> http.createServer(function(request, response) {
> http.get(request.url, function(res) {
>   console.log("Got response: " + res.statusCode);
>     res.on('data', function(d) {
>       response.write(d);
>   });
>    res.on('end', function() {
>      response.end();
>     });}).on('error', function(e) {
>   console.log("Got error: " + e.message);});}).listen(8080);
>
> it's working in local but it doesn't work when i use it remotely(i'm using 
> appfog as a host).
>
> am i missing something?
>
>  --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to