From 8a04e17631d8eea1004fe8573f390e84461f1ed4 Mon Sep 17 00:00:00 2001 From: cnlh Date: Thu, 13 Feb 2020 17:52:49 +0800 Subject: [PATCH 1/3] change md --- docs/run.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/run.md b/docs/run.md index 805e154..ca1f323 100644 --- a/docs/run.md +++ b/docs/run.md @@ -26,7 +26,9 @@ ## 客户端 - 下载客户端安装包并解压,进入到解压目录 - 点击web管理中客户端前的+号,复制启动命令 -- 执行启动命令,linux直接执行即可,windows将./npc换成npc.exe用cmd执行 +- 执行启动命令,linux直接执行即可,windows将./npc换成npc.exe用**cmd执行** + +如果使用`powershell`运行,**请将ip括起来!** 如果需要注册到系统服务可查看[注册到系统服务](/use?id=注册到系统服务) From acb4e50ee7b2926806a8ee8597528095bd9dae19 Mon Sep 17 00:00:00 2001 From: yzy613 <59520517+yzy613@users.noreply.github.com> Date: Fri, 14 Feb 2020 08:42:59 -0600 Subject: [PATCH 2/3] Update p2p tips (#408) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update example.md 新增p2p防火墙端口开放范围 * Update faq.md * Update faq.md 添加p2p引导 Co-authored-by: ffdfgdfg --- docs/example.md | 1 + docs/faq.md | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docs/example.md b/docs/example.md index 2da0b87..141c219 100644 --- a/docs/example.md +++ b/docs/example.md @@ -108,6 +108,7 @@ **使用步骤** - 在`nps.conf`中设置`p2p_ip`(nps服务器ip)和`p2p_port`(nps服务器udp端口) +> 注:若 `p2p_port` 设置为6000,请在防火墙开放6000~6002(额外添加2个端口)udp端口 - 在刚才刚才创建的客户端中添加一条p2p代理,并设置唯一密钥p2pssh - 在使用端机器(本机)执行命令 diff --git a/docs/faq.md b/docs/faq.md index a8efdcf..424e6db 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -14,3 +14,7 @@ ``` install 之后,Linux 配置文件在 /etc/nps ``` +- p2p穿透失败 [p2p服务](https://ehang-io.github.io/nps/#/example?id=p2p%e6%9c%8d%e5%8a%a1) +``` +双方nat类型都是Symmetric Nat一定不成功,建议先查看nat类型。请按照文档操作(标题上有超链接) +``` From 26f48aa7f13342f4dddeea7ef276aec8ccc4efdc Mon Sep 17 00:00:00 2001 From: cnlh Date: Sun, 16 Feb 2020 20:42:36 +0800 Subject: [PATCH 3/3] close client connection when tcp lost connection in socks5 --- server/proxy/socks5.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server/proxy/socks5.go b/server/proxy/socks5.go index f2ee2d5..3faefe5 100755 --- a/server/proxy/socks5.go +++ b/server/proxy/socks5.go @@ -270,6 +270,7 @@ func (s *Sock5ModeServer) handleUDP(c net.Conn) { b := common.BufPoolUdp.Get().([]byte) defer common.BufPoolUdp.Put(b) + defer target.Close() for { _, err := c.Read(b) if err != nil {