An open API service indexing awesome lists of open source software.

https://github.com/lizhengnacl/proxy

方便web开发者调试,包括HTTPS
https://github.com/lizhengnacl/proxy

development https proxy web

Last synced: 9 months ago
JSON representation

方便web开发者调试,包括HTTPS

Awesome Lists containing this project

README

          

# 说明

## 安装
```
git clone https://github.com/lizhengnacl/proxy.git

cd proxy && npm i
```

## 使用
1. 依赖nginx,主要是方便调试HTTPS,请先安装nginx
2. 确保已经开启nginx

修改main.js中的配置项

```
const config = {
nginxConf: {
path: resolve(__dirname, './nginx.conf'), // 绝对路径,本地nginx配置文件路径
certPath: '/usr/local/nginx/HTTPS', // 绝对路径,指向证书的路径,如果不需要调试HTTPS,可忽略
forceReload: false // 强制更新,断网重连,默认关闭
},
hostConfig: {
path: resolve(__dirname, './hosts.md') // 绝对路径,指向hosts配置文件
}
};
```

hosts配置文件
80端口可省略;https使用443端口

```
# comments

127.0.0.1:8081 a.test.com
127.0.0.1:8082 b.test.com
# 127.0.0.1:9002 oa.neixin.cn:443
```

启动

```
sudo node main.js
```

清除浏览器DNS缓存

```
chrome://net-internals/#dns
```

## TODO
1. HTTPS 支持,证书路径 `done`
2. 恢复nginx config `done`
3. 依赖检测,nginx
3. 判断nginx是否启动