File tree 2 files changed +5
-15
lines changed
2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,6 @@ var http = require('http'),
8
8
*/
9
9
module . exports = httpProxy . Server ;
10
10
11
- module . exports . createProxy = function ( options ) {
12
- return {
13
- web : httpProxy . createRightProxy ( 'web' ) ( options ) ,
14
- ws : httpProxy . createRightProxy ( 'ws' ) ( options )
15
- } ;
16
- }
17
-
18
11
/**
19
12
* Creates the proxy server.
20
13
*
@@ -30,7 +23,9 @@ module.exports.createProxy = function(options) {
30
23
* @api public
31
24
*/
32
25
33
- module . exports . createProxyServer = module . exports . createServer = function createProxyServer ( options ) {
26
+ module . exports . createProxyServer =
27
+ module . exports . createServer =
28
+ module . exports . createProxy = function createProxyServer ( options ) {
34
29
/*
35
30
* `options` is needed and it must have the following layout:
36
31
*
Original file line number Diff line number Diff line change @@ -26,15 +26,10 @@ httpProxy.Server = ProxyServer;
26
26
*/
27
27
28
28
function createRightProxy ( type ) {
29
- var webPasses = Object . keys ( web ) . map ( function ( pass ) {
30
- return web [ pass ] ;
31
- } ) ;
32
- var wsPasses = Object . keys ( ws ) . map ( function ( pass ) {
33
- return ws [ pass ] ;
34
- } ) ;
29
+
35
30
return function ( options ) {
36
31
return function ( req , res /*, [head], [opts] */ ) {
37
- var passes = ( type === 'ws' ) ? ( this . wsPasses || wsPasses ) : ( this . webPasses || webPasses ) ,
32
+ var passes = ( type === 'ws' ) ? this . wsPasses : this . webPasses ,
38
33
args = [ ] . slice . call ( arguments ) ,
39
34
cntr = args . length - 1 ,
40
35
head , cbl ;
You can’t perform that action at this time.
0 commit comments