anyproxy/test/spec_rule/no_rule_spec.js
2018-05-05 15:56:45 +08:00

25 lines
655 B
JavaScript

process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
const NoRuleSpecExec = require('./no_rule_spec_exec');
const ProxyServerUtil = require('../util/ProxyServerUtil.js');
const { printLog } = require('../util/CommonUtil.js');
const getStartProxyFunc = function (needWeb) {
return function () {
printLog('Start AnyProxy by node module');
return ProxyServerUtil.defaultProxyServer(needWeb);
}
}
const closeProxyFunc = function (instance) {
printLog('Close AnyProxy by node module');
instance.close();
}
testRequest();
testRequest(false);
function testRequest(needWeb = true) {
NoRuleSpecExec(getStartProxyFunc(needWeb), closeProxyFunc);
}