From 7b79a7409ade7a8c79b2ae5761abc4843529063a Mon Sep 17 00:00:00 2001 From: Damian Kaczmarek Date: Tue, 10 Jun 2014 19:04:12 +0200 Subject: [PATCH] Change name targetTimeout to proxyTimeout --- lib/http-proxy/passes/web-incoming.js | 4 ++-- test/lib-http-proxy-passes-web-incoming-test.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/http-proxy/passes/web-incoming.js b/lib/http-proxy/passes/web-incoming.js index 8d0fc47..056236e 100644 --- a/lib/http-proxy/passes/web-incoming.js +++ b/lib/http-proxy/passes/web-incoming.js @@ -111,8 +111,8 @@ web_o = Object.keys(web_o).map(function(pass) { // allow outgoing socket to timeout so that we could // show an error page at the initial request - if(options.targetTimeout) { - proxyReq.setTimeout(options.targetTimeout, function() { + if(options.proxyTimeout) { + proxyReq.setTimeout(options.proxyTimeout, function() { proxyReq.abort(); }); } diff --git a/test/lib-http-proxy-passes-web-incoming-test.js b/test/lib-http-proxy-passes-web-incoming-test.js index 8d2adfe..93c76ca 100644 --- a/test/lib-http-proxy-passes-web-incoming-test.js +++ b/test/lib-http-proxy-passes-web-incoming-test.js @@ -128,10 +128,10 @@ describe('#createProxyServer.web() using own http server', function () { }, function() {}).end(); }); - it('should proxy the request and handle timeout error (targetTimeout)', function(done) { + it('should proxy the request and handle timeout error (proxyTimeout)', function(done) { var proxy = httpProxy.createProxyServer({ target: 'http://127.0.0.1:45000', - targetTimeout: 100 + proxyTimeout: 100 }); require('net').createServer().listen(45000);