mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
ENH: updated target and forward options so that a string may be specified
This commit is contained in:
parent
268afe34bb
commit
ef946a7697
@ -1,5 +1,6 @@
|
|||||||
var caronte = exports,
|
var caronte = exports,
|
||||||
extend = require('util')._extend,
|
extend = require('util')._extend,
|
||||||
|
parse_url = require('url').parse,
|
||||||
web = require('./passes/web-incoming'),
|
web = require('./passes/web-incoming'),
|
||||||
ws = require('./passes/ws-incoming');
|
ws = require('./passes/ws-incoming');
|
||||||
|
|
||||||
@ -56,6 +57,11 @@ function createRightProxy(type) {
|
|||||||
|
|
||||||
options.ee.emit(ev + 'begin', req, res);
|
options.ee.emit(ev + 'begin', req, res);
|
||||||
|
|
||||||
|
['target', 'forward'].forEach(
|
||||||
|
function(e) {
|
||||||
|
if (typeof options[e] === 'string')
|
||||||
|
options[e] = parse_url(options[e]);
|
||||||
|
});
|
||||||
|
|
||||||
passes.some(function(pass) {
|
passes.some(function(pass) {
|
||||||
var evnt = ev + pass.name.toLowerCase() + ':';
|
var evnt = ev + pass.name.toLowerCase() + ':';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user