mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-08-04 21:39:04 +00:00
update doc ,ready to push to npm
This commit is contained in:
@@ -4,7 +4,7 @@ var exec = require('child_process').exec,
|
||||
fs = require("fs"),
|
||||
os = require("os"),
|
||||
color = require('colorful'),
|
||||
asyncTask = require("./asyncTaskMgr");
|
||||
asyncTask = require("async-task-mgr");
|
||||
|
||||
var certDir = path.join(getUserHome(),"/.anyproxy_certs/"),
|
||||
cmdDir = path.join(__dirname,"..","./cert/"),
|
||||
@@ -19,16 +19,16 @@ function getCertificate(hostname,cb){
|
||||
crtFile = path.join(certDir , "__hostname.crt".replace(/__hostname/,hostname) );
|
||||
|
||||
if(!fs.existsSync(keyFile) || !fs.existsSync(crtFile)){
|
||||
asyncTaskMgr.addTask(hostname,function(err){
|
||||
asyncTaskMgr.addTask(hostname,function(cb){
|
||||
createCert(hostname,function(err){
|
||||
cb(err ? err : null);
|
||||
});
|
||||
},function(err){
|
||||
if(!err){
|
||||
cb(null , fs.readFileSync(keyFile) , fs.readFileSync(crtFile) );
|
||||
}else{
|
||||
cb(err);
|
||||
}
|
||||
},function(cb){
|
||||
createCert(hostname,function(err){
|
||||
cb(err ? -1 : null);
|
||||
});
|
||||
});
|
||||
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user