Skip to content

Commit

Permalink
fix: global proxyHTTP causes multiple event binding (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
syhmosh authored and jaywcjlove committed Aug 28, 2019
1 parent b031c8f commit 4e8bc03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -7,7 +7,6 @@ const parse = require('url').parse;
const chokidar = require('chokidar');
const color = require('colors-cli/safe');

const proxyHTTP = httpProxy.createProxyServer({});
let mocker = {};

function pathMatch(options) {
Expand Down Expand Up @@ -139,6 +138,7 @@ module.exports = function (app, watchFile, conf = {}) {
}
});
} else if (proxyKey && proxyConf[proxyKey]) {
const proxyHTTP = httpProxy.createProxyServer({});
const currentProxy = proxyConf[proxyKey];
const url = parse(currentProxy);
if (changeHost) {
Expand Down

0 comments on commit 4e8bc03

Please sign in to comment.