1
0
mirror of https://github.com/alibaba/anyproxy.git synced 2025-05-10 06:48:26 +00:00

update doc, bugfix for certMgr

This commit is contained in:
OttoMao 2014-11-13 10:05:56 +08:00
parent 0e387382c8
commit 7c5f9f72af
4 changed files with 14 additions and 7 deletions

@ -2,10 +2,12 @@ anyproxy
==========
A fully configurable proxy in NodeJS, which can handle HTTPS requests perfectly.
(Chinese in this doc is nothing but translation of some key points. Be relax if you dont understand.)
[wiki - 代理服务器的新轮子](https://github.com/alibaba/anyproxy/wiki/%E4%BB%A3%E7%90%86%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84%E6%96%B0%E8%BD%AE%E5%AD%90%EF%BC%9Aanyproxy) 介绍我们为什么要再造一个代理服务器anyproxy与众不同的结构与功能。
![](https://i.alipayobjects.com/i/ecmng/png/201409/3NKRCRk2Uf.png_250x.png)
(Chinese in this doc is nothing but translation of some key points. Be relax if you dont understand.)
Feature
------------
* work as http or https proxy

@ -14,12 +14,17 @@ var certDir = path.join(util.getUserHome(),"/.anyproxy_certs/"),
cmd_genCert = path.join(cmdDir,"./gen-cer"),
asyncTaskMgr = new asyncTask();
if(!fs.existsSync(certDir)){
fs.mkdirSync(certDir,0777);
try{
fs.mkdirSync(certDir,0777); //may fail in windows
}catch(e){
console.log("===========");
console.log("failed to create cert dir ,please create one by yourself - " + certDir);
console.log("this error will not block main thread unless you use https-related features in anyproxy");
console.log("===========");
}
}
function getCertificate(hostname,cb){
var keyFile = path.join(certDir , "__hostname.key".replace(/__hostname/,hostname) ),
crtFile = path.join(certDir , "__hostname.crt".replace(/__hostname/,hostname) );

@ -1,6 +1,6 @@
{
"name": "anyproxy",
"version": "2.8.3",
"version": "2.8.7",
"description": "A fully configurable proxy in NodeJS, which can handle HTTPS requests perfectly.",
"main": "proxy.js",
"bin": {

@ -55,8 +55,8 @@ if(!fs.existsSync(anyproxyHome)){
if(fs.existsSync(path.join(anyproxyHome,"rule_default.js"))){
default_rule = require(path.join(anyproxyHome,"rule_default"));
}
if(fs.existsSync(process.cwd() + '/rule.js')){
default_rule = require(process.cwd() + '/rule');
if(fs.existsSync(path.join(process.cwd(),'rule.js'))){
default_rule = require(path.join(process.cwd(),'rule'));
}
//option