You're viewing a comment by Marc and its responses.

Marc Permalink
October 21, 2012, 07:03

Would you mind knocking together a simple *reverse* proxy with node? Everyone seems to recommend using one of the modules (like http-proxy or bounce) but surely a simple reverse proxy (which listens on localhost:80 and forwards to google.com:80) is a trivial excercise. Googling so far has produced nothing!

Comment Responses

Marc Permalink
October 22, 2012, 13:39

Aha, just changing this line:
var proxy = http.createClient(80, request.headers['host'])
to
var proxy = http.createClient(80, 'google.com')
makes it a reverse proxy instead of a normal HTTP proxy.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the word "unix_215": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.