mirror of https://github.com/ehang-io/nps
update docs, close #424
parent
f522bdb6ee
commit
7f38e1fa0d
10
README.md
10
README.md
|
@ -46,6 +46,16 @@ For windows, run cmd as administrator and enter the installation directory ```np
|
|||
|
||||
- start up
|
||||
|
||||
- default ports
|
||||
|
||||
The default configuration file of nps use 80,443,8080,8024 ports
|
||||
|
||||
80 and 443 ports for host mode default ports
|
||||
|
||||
8080 for web management access port
|
||||
|
||||
8024 for net bridge port, to communicate between server and client
|
||||
|
||||
For linux、darwin ```sudo nps start```
|
||||
|
||||
For windows, run cmd as administrator and enter the program directory ```nps.exe start```
|
||||
|
|
10
README_zh.md
10
README_zh.md
|
@ -50,6 +50,16 @@ nps是一款轻量级、高性能、功能强大的**内网穿透**代理服务
|
|||
|
||||
对于windows,管理员身份运行cmd,进入安装目录 ```nps.exe install```
|
||||
|
||||
- 默认端口
|
||||
|
||||
nps默认配置文件使用了80,443,8080,8024端口
|
||||
|
||||
80与443端口为域名解析模式默认端口
|
||||
|
||||
8080为web管理访问端口
|
||||
|
||||
8024为网桥端口,用于客户端与服务器通信
|
||||
|
||||
- 启动
|
||||
|
||||
对于linux|darwin ```sudo nps start```
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
**适用范围:** 小程序开发、微信公众号开发、产品演示
|
||||
|
||||
**注意:域名解析模式为http反向代理,不是dns服务器,在web上能够轻松灵活配置**
|
||||
|
||||
**假设场景:**
|
||||
- 有一个域名proxy.com,有一台公网机器ip为1.1.1.1
|
||||
- 两个内网开发站点127.0.0.1:81,127.0.0.1:82
|
||||
|
@ -77,6 +79,8 @@
|
|||
- 在刚才创建的客户端隧道管理中添加一条http代理,填写监听的端口(8004),保存。
|
||||
- 在外网环境的本机配置http代理,ip为公网服务器ip(1.1.1.1),端口为填写的监听端口(8004),即可访问了
|
||||
|
||||
**注意:对于私密代理与p2p,除了统一配置的客户端和服务端,还需要一个客户端作为访问端提供一个端口来访问**
|
||||
|
||||
## 私密代理
|
||||
|
||||
**适用范围:** 无需占用多余的端口、安全性要求较高可以防止其他人连接的tcp服务,例如ssh。
|
||||
|
@ -95,7 +99,7 @@
|
|||
|
||||
**注意:** password为web管理上添加的唯一密钥,具体命令可查看web管理上的命令提示
|
||||
|
||||
假设10.1.50.2用户名为root,现在执行`ssh -p 2000 root@1.1.1.1`即可访问ssh
|
||||
假设10.1.50.2用户名为root,现在执行`ssh -p 2000 root@127.0.0.1`即可访问ssh
|
||||
|
||||
|
||||
## p2p服务
|
||||
|
|
|
@ -14,18 +14,18 @@
|
|||
|
||||
## 与nginx配合
|
||||
|
||||
有时候我们还需要在云服务器上运行nginx来保证静态文件缓存等,本代理可和nginx配合使用,在配置文件中将httpProxyPort设置为非80端口,并在nginx中配置代理,例如httpProxyPort为8024时
|
||||
有时候我们还需要在云服务器上运行nginx来保证静态文件缓存等,本代理可和nginx配合使用,在配置文件中将httpProxyPort设置为非80端口,并在nginx中配置代理,例如httpProxyPort为8010时
|
||||
```
|
||||
server {
|
||||
listen 80;
|
||||
server_name *.proxy.com;
|
||||
location / {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_pass http://127.0.0.1:8024;
|
||||
proxy_pass http://127.0.0.1:8010;
|
||||
}
|
||||
}
|
||||
```
|
||||
如需使用https也可在nginx监听443端口并配置ssl,并将本代理的httpsProxyPort设置为空关闭https即可,例如httpProxyPort为8024时
|
||||
如需使用https也可在nginx监听443端口并配置ssl,并将本代理的httpsProxyPort设置为空关闭https即可,例如httpProxyPort为8020时
|
||||
|
||||
```
|
||||
server {
|
||||
|
@ -40,7 +40,7 @@ server {
|
|||
ssl_prefer_server_ciphers on;
|
||||
location / {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_pass http://127.0.0.1:8024;
|
||||
proxy_pass http://127.0.0.1:8020;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue