MCPcopy
hub / github.com/alibaba/anyproxy / proxyServerWithRule

Function proxyServerWithRule

test/util/ProxyServerUtil.js:44–57  ·  view source on GitHub ↗
(rule, overrideConfig)

Source from the content-addressed store, hash-verified

42 @return An instance of proxy, could be closed by calling `instance.close()`
43*/
44function proxyServerWithRule(rule, overrideConfig) {
45 const AnyProxy = util.freshRequire('../proxy.js');
46
47 const options = Object.assign({}, DEFAULT_OPTIONS, overrideConfig);
48 options.rule = rule;
49
50 const instance = new AnyProxy.ProxyServer(options);
51 instance.on('error', e => {
52 console.log('server instance error', e);
53 });
54 instance.start();
55
56 return instance;
57}
58
59function proxyServerWithoutHttpsIntercept(rule) {
60 const AnyProxy = util.freshRequire('../proxy.js');

Callers

nothing calls this directly

Calls 1

startMethod · 0.95

Tested by

no test coverage detected