Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

little nice things

  • Loading branch information...
commit 38a93675805bbca292f6d543b891a061b800e9bb 1 parent 79a8663
@pquerna authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 limiting_concurrency/server_nolimit.js
View
6 limiting_concurrency/server_nolimit.js 100644 → 100755
@@ -1,3 +1,4 @@
+#!/usr/bin/env node
/* This code is PUBLIC DOMAIN, and is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND. See the accompanying
* LICENSE file.
@@ -11,12 +12,13 @@ http.createServer(function(req, res) {
var proxy = http.createClient(80, destination);
var preq = proxy.request(req.method, req.url, req.headers);
+ console.log(req.connection.remoteAddress +" "+ req.method +" "+req.url);
preq.on('response', function(pres) {
res.writeHead(pres.statusCode, pres.headers);
sys.pump(pres, res);
pres.on('end', function() {
- preq.close();
- res.close();
+ preq.end();
+ res.end();
})
});
req.on('data', function(chunk) {

0 comments on commit 38a9367

Please sign in to comment.
Something went wrong with that request. Please try again.