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
- Host: GitHub
- URL: https://github.com/lizhengnacl/proxy
- Owner: lizhengnacl
- Created: 2018-06-03T10:59:28.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-05T08:27:31.000Z (almost 8 years ago)
- Last Synced: 2025-03-09T22:39:51.700Z (about 1 year ago)
- Topics: development, https, proxy, web
- Language: JavaScript
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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是否启动