mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-04-20 12:54:20 +00:00
19 lines
613 B
JavaScript
19 lines
613 B
JavaScript
var program = require('commander'),
|
|
mainProxy = require("./proxy.js");
|
|
|
|
program
|
|
.option('-u, --host [value]', 'hostname for https proxy, localhost for default')
|
|
.option('-t, --type [value]', 'http|https,http for default')
|
|
.option('-p, --port [value]', 'proxy port, 8001 for default')
|
|
.option('-c, --clear', 'clear all the tmp certificates')
|
|
.parse(process.argv);
|
|
|
|
if(program.clear){
|
|
require("./lib/certMgr").clearCerts(function(){
|
|
console.log("all certs cleared");
|
|
process.exit(0);
|
|
});
|
|
|
|
}else{
|
|
mainProxy.startServer(program.type,program.port, program.host);
|
|
} |