Skip to content

Instantly share code, notes, and snippets.

@graphnode
Created July 15, 2010 14:59
Show Gist options
  • Save graphnode/477061 to your computer and use it in GitHub Desktop.
Save graphnode/477061 to your computer and use it in GitHub Desktop.
var sys = require('sys');
var http = require('http');
var time = (new Date).getTime();
var ep = http.createClient(80, "localhost");
http.createServer(function(ureq, ures) {
var request = ep.request('get', '/help/', {'host': "localhost"});
request.addListener('response', function(resp) {
ures.writeHead(200, resp.headers);
sys.pump(resp, ures, function() {
request.end();
ures.end();
});
});
}).listen(9090);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment