Skip to content

Commit

Permalink
little nice things
Browse files Browse the repository at this point in the history
  • Loading branch information
pquerna committed Sep 5, 2010
1 parent 79a8663 commit 38a9367
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions limiting_concurrency/server_nolimit.js
100644 → 100755
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env node
/* This code is PUBLIC DOMAIN, and is distributed on an "AS IS" BASIS, /* This code is PUBLIC DOMAIN, and is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND. See the accompanying * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND. See the accompanying
* LICENSE file. * LICENSE file.
Expand All @@ -11,12 +12,13 @@ http.createServer(function(req, res) {
var proxy = http.createClient(80, destination); var proxy = http.createClient(80, destination);
var preq = proxy.request(req.method, req.url, req.headers); var preq = proxy.request(req.method, req.url, req.headers);


console.log(req.connection.remoteAddress +" "+ req.method +" "+req.url);
preq.on('response', function(pres) { preq.on('response', function(pres) {
res.writeHead(pres.statusCode, pres.headers); res.writeHead(pres.statusCode, pres.headers);
sys.pump(pres, res); sys.pump(pres, res);
pres.on('end', function() { pres.on('end', function() {
preq.close(); preq.end();
res.close(); res.end();
}) })
}); });
req.on('data', function(chunk) { req.on('data', function(chunk) {
Expand Down

0 comments on commit 38a9367

Please sign in to comment.