Sitelet https://github.com/yufi113/anyproxy/commit/7c5f9f72afe72c906ef50281f99addc628e38de3
Skip to content

Commit 7c5f9f7

Browse files
committed
update doc, bugfix for certMgr
1 parent 0e38738 commit 7c5f9f7

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

‎README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ anyproxy
22
==========
33
A fully configurable proxy in NodeJS, which can handle HTTPS requests perfectly.
44

5-
(Chinese in this doc is nothing but translation of some key points. Be relax if you dont understand.)
5+
[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与众不同的结构与功能。
66

77
![](https://i.alipayobjects.com/i/ecmng/png/201409/3NKRCRk2Uf.png_250x.png)
88

9+
(Chinese in this doc is nothing but translation of some key points. Be relax if you dont understand.)
10+
911
Feature
1012
------------
1113
* work as http or https proxy

‎lib/certMgr.js‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ var certDir = path.join(util.getUserHome(),"/.anyproxy_certs/"),
1414
cmd_genCert = path.join(cmdDir,"./gen-cer"),
1515
asyncTaskMgr = new asyncTask();
1616

17-
1817
if(!fs.existsSync(certDir)){
19-
fs.mkdirSync(certDir,0777);
18+
try{
19+
fs.mkdirSync(certDir,0777); //may fail in windows
20+
}catch(e){
21+
console.log("===========");
22+
console.log("failed to create cert dir ,please create one by yourself - " + certDir);
23+
console.log("this error will not block main thread unless you use https-related features in anyproxy");
24+
console.log("===========");
25+
}
2026
}
2127

22-
2328
function getCertificate(hostname,cb){
2429
var keyFile = path.join(certDir , "__hostname.key".replace(/__hostname/,hostname) ),
2530
crtFile = path.join(certDir , "__hostname.crt".replace(/__hostname/,hostname) );

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "anyproxy",
3-
"version": "2.8.3",
3+
"version": "2.8.7",
44
"description": "A fully configurable proxy in NodeJS, which can handle HTTPS requests perfectly.",
55
"main": "proxy.js",
66
"bin": {

‎proxy.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ if(!fs.existsSync(anyproxyHome)){
5555
if(fs.existsSync(path.join(anyproxyHome,"rule_default.js"))){
5656
default_rule = require(path.join(anyproxyHome,"rule_default"));
5757
}
58-
if(fs.existsSync(process.cwd() + '/rule.js')){
59-
default_rule = require(process.cwd() + '/rule');
58+
if(fs.existsSync(path.join(process.cwd(),'rule.js'))){
59+
default_rule = require(path.join(process.cwd(),'rule'));
6060
}
6161

6262
//option

0 commit comments

Comments
 (0)