mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
fixed additional port / server mismatches for new api
This commit is contained in:
parent
bde98f4892
commit
15c18b612d
@ -25,7 +25,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
var sys = require('sys'),
|
var sys = require('sys'),
|
||||||
eyes = require('eyes'),
|
|
||||||
http = require('http'),
|
http = require('http'),
|
||||||
events = require('events');
|
events = require('events');
|
||||||
|
|
||||||
@ -74,7 +73,7 @@ exports.HttpProxy.prototype = {
|
|||||||
callback(req, res, self);
|
callback(req, res, self);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
self.proxyRequest(server, port, req, res);
|
self.proxyRequest(port, server, req, res);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -114,7 +113,7 @@ exports.HttpProxy.prototype = {
|
|||||||
delete this.events[req];
|
delete this.events[req];
|
||||||
},
|
},
|
||||||
|
|
||||||
proxyRequest: function (server, port, req, res) {
|
proxyRequest: function (port, server, req, res) {
|
||||||
// Remark: nodeProxy.body exists solely for testability
|
// Remark: nodeProxy.body exists solely for testability
|
||||||
this.body = '';
|
this.body = '';
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|||||||
@ -46,7 +46,7 @@ var startProxyServer = function (port, server, proxy) {
|
|||||||
//
|
//
|
||||||
// Creates the reverse proxy server with a specified latency
|
// Creates the reverse proxy server with a specified latency
|
||||||
//
|
//
|
||||||
var startLatentProxyServer = function (server, port, proxy, latency) {
|
var startLatentProxyServer = function (port, server, proxy, latency) {
|
||||||
// Initialize the nodeProxy and start proxying the request
|
// Initialize the nodeProxy and start proxying the request
|
||||||
var proxyServer = proxy.createServer(function (req, res, proxy) {
|
var proxyServer = proxy.createServer(function (req, res, proxy) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user