From a7ef1b2215da53fea574b16b4bb88e01184b531a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8A=A0=E9=87=8C?= Date: Mon, 17 Nov 2014 11:02:24 +0800 Subject: [PATCH] use custom port for test.js --- lib/requestHandler.js | 1 + proxy.js | 1 - test.js | 5 +++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/requestHandler.js b/lib/requestHandler.js index b3f284c..c2b81fd 100644 --- a/lib/requestHandler.js +++ b/lib/requestHandler.js @@ -302,6 +302,7 @@ function connectReqHandler(req, socket, head){ socket.write('HTTP/' + req.httpVersion + ' 200 OK\r\n\r\n', 'UTF-8', function() { conn.pipe(socket); socket.pipe(conn); + callback(); }); }); diff --git a/proxy.js b/proxy.js index 0e42d7a..5e38af2 100644 --- a/proxy.js +++ b/proxy.js @@ -149,7 +149,6 @@ function proxyServer(option){ } }); - //TODO : uncaught exception //kill web server when father process exits process.on("exit",function(code){ child_webServer.kill(); diff --git a/test.js b/test.js index ad08da7..9d6f435 100644 --- a/test.js +++ b/test.js @@ -2,11 +2,12 @@ var tester = require("proxy-eval"), proxy = require("./proxy.js"); new proxy.proxyServer({ - type:"http" + type:"http", + port:8995 }); setTimeout(function(){ - tester.test( {proxy : 'http://127.0.0.1:8001',reqTimeout:3000} ,function(results){ + tester.test( {proxy : 'http://127.0.0.1:8995',reqTimeout:3000} ,function(results){ tester.printResult(results); process.exit(); });