mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-04-24 00:41:25 +00:00
25 lines
655 B
JavaScript
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);
|
|
}
|