Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ffdfgdfg committed Feb 8, 2020
1 parent 099d3fc commit 72c695d
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 20 deletions.
1 change: 1 addition & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

* 其他

* [FAQ](faq.md)
* [贡献](contribute.md)
* [捐助](donate.md)
* [致谢](thanks.md)
Expand Down
5 changes: 1 addition & 4 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,4 @@ POST /auth/getauthkey
- 解密串编码方式 十六进制

## 详细文档
- **此文档近期可能更新较慢,建议自行抓包**

为方便第三方扩展,在web模式下可利用webAPI进行相关操作,详情见
[webAPI文档](https://github.com/ehang-io/nps/wiki/webAPI%E6%96%87%E6%A1%A3)
- **[详见](webapi.md)** (感谢@avengexyz)
8 changes: 4 additions & 4 deletions docs/example.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# 使用示例
## 统一准备工作(必做)
- 开启服务端,假设公网服务器ip为1.1.1.1,配置文件中`bridge_port`为8284,配置文件中`web_port`为8080
- 开启服务端,假设公网服务器ip为1.1.1.1,配置文件中`bridge_port`为8024,配置文件中`web_port`为8080
- 访问1.1.1.1:8080
- 在客户端管理中创建一个客户端,记录下验证密钥
- 内网客户端运行(windows使用cmd运行加.exe)

```shell
./npc -server=1.1.1.1:8284 -vkey=客户端的密钥
./npc -server=1.1.1.1:8024 -vkey=客户端的密钥
```
**注意:运行服务端后,请确保能从客户端设备上正常访问配置文件中所配置的`bridge_port`端口,telnet,netcat这类的来检查**

Expand Down Expand Up @@ -89,7 +89,7 @@
- 在需要连接ssh的机器上以执行命令

```
./npc -server=1.1.1.1:8284 -vkey=vkey -type=tcp -password=secrettest -local_type=secret
./npc -server=1.1.1.1:8024 -vkey=vkey -type=tcp -password=secrettest -local_type=secret
```
如需指定本地端口可加参数`-local_port=xx`,默认为2000

Expand All @@ -112,7 +112,7 @@
- 在使用端机器(本机)执行命令

```
./npc -server=1.1.1.1:8284 -vkey=123 -password=p2pssh -target=10.2.50.2:22
./npc -server=1.1.1.1:8024 -vkey=123 -password=p2pssh -target=10.2.50.2:22
```
如需指定本地端口可加参数`-local_port=xx`,默认为2000

Expand Down
15 changes: 15 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# FAQ

- 服务端无法启动

服务端默认配置启用了8024,8080,80,443端口,端口冲突无法启动,请修改配置

- 客户端无法连接服务端

请检查配置文件中的所有端口是否在安全组,防火墙放行
请检查vkey是否对应
请检查版本是否对应

- 服务端配置文件修改无效

install之后,linux配置文件在/etc/nps
2 changes: 1 addition & 1 deletion docs/feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ npc支持环境变量渲染以适应在某些特殊场景下的要求。
**在无配置文件启动模式下:**
设置环境变量
```
export NPC_SERVER_ADDR=1.1.1.1:8284
export NPC_SERVER_ADDR=1.1.1.1:8024
export NPC_SERVER_VKEY=xxxxx
```
直接执行./npc即可运行
Expand Down
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## 源码安装
- 安装源码
```go get -u ehang.io/nps...```
```go get -u ehang.io/nps```
- 编译

服务端```go build cmd/nps/nps.go```
Expand Down
18 changes: 9 additions & 9 deletions docs/use.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ npc-update.exe update
#### 全局配置
```ini
[common]
server_addr=1.1.1.1:8284
server_addr=1.1.1.1:8024
conn_type=tcp
vkey=123
username=111
Expand Down Expand Up @@ -77,7 +77,7 @@ max_conn|最大连接数,可忽略

```ini
[common]
server_addr=1.1.1.1:8284
server_addr=1.1.1.1:8024
vkey=123
[web1]
host=a.proxy.com
Expand All @@ -97,7 +97,7 @@ header_xxx|请求header修改或添加,header_proxy表示添加header proxy:np

```ini
[common]
server_addr=1.1.1.1:8284
server_addr=1.1.1.1:8024
vkey=123
[tcp]
mode=tcp
Expand All @@ -114,7 +114,7 @@ tartget_addr|内网目标

```ini
[common]
server_addr=1.1.1.1:8284
server_addr=1.1.1.1:8024
vkey=123
[udp]
mode=udp
Expand All @@ -130,7 +130,7 @@ target_addr|内网目标

```ini
[common]
server_addr=1.1.1.1:8284
server_addr=1.1.1.1:8024
vkey=123
[http]
mode=httpProxy
Expand All @@ -144,7 +144,7 @@ server_port | 在服务端的代理端口

```ini
[common]
server_addr=1.1.1.1:8284
server_addr=1.1.1.1:8024
vkey=123
[socks5]
mode=socks5
Expand All @@ -160,7 +160,7 @@ multi_account | socks5多账号配置文件(可选),配置后使用basic_usern

```ini
[common]
server_addr=1.1.1.1:8284
server_addr=1.1.1.1:8024
vkey=123
[secret_ssh]
mode=secret
Expand All @@ -177,7 +177,7 @@ target_addr|内网目标

```ini
[common]
server_addr=1.1.1.1:8284
server_addr=1.1.1.1:8024
vkey=123
[p2p_ssh]
mode=p2p
Expand All @@ -196,7 +196,7 @@ target_addr|内网目标

```ini
[common]
server_addr=1.1.1.1:8284
server_addr=1.1.1.1:8024
vkey=123
[file]
mode=file
Expand Down
2 changes: 1 addition & 1 deletion docs/webapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ POST /client/add/
| max\_tunnel | 客户端最大隧道数量 空则为不限制 |

***
修改客户端(25.4版本有问题暂时不能用)
修改客户端

```
POST /client/edit/
Expand Down

0 comments on commit 72c695d

Please sign in to comment.