Skip to content

Commit

Permalink
[fix] better code
Browse files Browse the repository at this point in the history
  • Loading branch information
yawnt committed Oct 9, 2013
1 parent 5a1504f commit 3d8e538
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/http-proxy.js
Expand Up @@ -39,6 +39,6 @@ proxy.createProxyServer = proxy.createServer = function createProxyServer(option
].join("\n"));
} */

return new ProxyServer(options, httpProxy.createWebProxy(options), httpProxy.createWsProxy(options));
return new ProxyServer(options);
};

12 changes: 5 additions & 7 deletions lib/http-proxy/index.js
Expand Up @@ -4,10 +4,8 @@ var httpProxy = exports,
EE3 = require('eventemitter3').EventEmitter,
web = require('./passes/web-incoming'),
ws = require('./passes/ws-incoming');

httpProxy.createWebProxy = createRightProxy('web');
httpProxy.createWsProxy = createRightProxy('ws');
httpProxy.Server = ProxyServer;

httpProxy.Server = ProxyServer;

/**
* Returns a function that creates the loader for
Expand Down Expand Up @@ -89,11 +87,11 @@ function createRightProxy(type) {
}


function ProxyServer(options, web, ws) {
function ProxyServer(options) {
EE3.call(this);

this.web = web;
this.ws = ws;
this.web = createRightProxy('web')(options);
this.ws = reateRightProxy('ws')(options);
this.options = options;

this.passes = Object.keys(passes).map(function(pass) {
Expand Down

0 comments on commit 3d8e538

Please sign in to comment.