You're replying to a comment by Leonardo Veríssimo.

Leonardo Veríssimo Permalink
October 25, 2012, 13:09

This proxy is using an old version of Node. Today, I needed a simple proxy, like yours, and using the latest version (0.8.12), a new proxy could be written this way:

var http = require('http');

http.createServer(function(request, response) {
	var proxyRequest = http.request({
		host: request.headers['host'],
		port: 80,
		path: request.url,
		method: request.method,
		headers: request.headers
	}, function(proxyResponse) {
		response.writeHead(proxyResponse.statusCode, proxyResponse.headers);

Just 14 lines!

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

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

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