From ef946a7697b38b13178881b3d1ebde63681dd4a1 Mon Sep 17 00:00:00 2001 From: srossross Date: Mon, 16 Sep 2013 10:49:53 -0700 Subject: [PATCH] ENH: updated target and forward options so that a string may be specified --- lib/caronte/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/caronte/index.js b/lib/caronte/index.js index 8a7e83742..ef0187fa9 100644 --- a/lib/caronte/index.js +++ b/lib/caronte/index.js @@ -1,5 +1,6 @@ var caronte = exports, extend = require('util')._extend, + parse_url = require('url').parse, web = require('./passes/web-incoming'), ws = require('./passes/ws-incoming'); @@ -56,7 +57,12 @@ function createRightProxy(type) { 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) { var evnt = ev + pass.name.toLowerCase() + ':';