Skip to content

Commit ef946a7

Browse files
committed
ENH: updated target and forward options so that a string may be specified
1 parent 268afe3 commit ef946a7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/caronte/index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var caronte = exports,
22
extend = require('util')._extend,
3+
parse_url = require('url').parse,
34
web = require('./passes/web-incoming'),
45
ws = require('./passes/ws-incoming');
56

@@ -56,7 +57,12 @@ function createRightProxy(type) {
5657

5758
options.ee.emit(ev + 'begin', req, res);
5859

59-
60+
['target', 'forward'].forEach(
61+
function(e) {
62+
if (typeof options[e] === 'string')
63+
options[e] = parse_url(options[e]);
64+
});
65+
6066
passes.some(function(pass) {
6167
var evnt = ev + pass.name.toLowerCase() + ':';
6268

0 commit comments

Comments
 (0)