yisier / nps Goto Github PK
View Code? Open in Web Editor NEWThis project forked from ehang-io/nps
基于NPS 0.29.10 版本二开而来,NPS接力项目。公益云NPS:https://natnps.com
License: GNU General Public License v3.0
This project forked from ehang-io/nps
基于NPS 0.29.10 版本二开而来,NPS接力项目。公益云NPS:https://natnps.com
License: GNU General Public License v3.0
建议楼主出一个开发文档,大家一起 上手维护这个项目
遇到几个问题不知道是正常:
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
nps服务端安装后,默认复制到C盘,不是很好维护,有时候更新会忘记更新相关内容,也容易导致conf配置文件不小心丢失了
希望能改进一下Basic 认证功能,主要是在编辑客户端开启了Basic 认证功能,底下所有Web都进行了认证加密,这点很不方便,有些站点须要加密认证,有些不要,能不能在新增WEB页面里添加Basic 认证功能,这样可以有选择
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots or logs
Add screenshots or logs to help explain your problem.
Server (please complete the following information):
Client (please complete the following information):
Additional context
Add any other context about the problem here.
2022/11/01 15:06:02 worker with func exits from a panic: runtime error: invalid memory address or nil pointer dereference
2022/11/01 15:06:02 worker with func exits from panic: goroutine 72 [running]:
github.com/panjf2000/ants/v2.(*goWorkerWithFunc).run.func1.1(0xc00030a2a0)
/go/pkg/mod/github.com/panjf2000/ants/[email protected]/worker_func.go:58 +0x165
panic(0xa66500, 0xf62ce0)
/usr/local/go/src/runtime/panic.go:969 +0x1b9
ehang.io/nps/lib/file.(*Flow).Add(0x0, 0x8000, 0x8000)
/go/src/ehang.io/nps/lib/file/obj.go:21 +0x33
ehang.io/nps/lib/goroutine.CopyBuffer(0x7efe6aebe858, 0xc000348020, 0xbd9960, 0xc000316050, 0x0, 0x0, 0xc0003043f0, 0xd, 0x0, 0x0)
/go/src/ehang.io/nps/lib/goroutine/pool.go:81 +0x2db
ehang.io/nps/lib/goroutine.copyConnGroup(0xad7d00, 0xc00031f630)
/go/src/ehang.io/nps/lib/goroutine/pool.go:114 +0x15d
github.com/panjf2000/ants/v2.(*goWorkerWithFunc).run.func1(0xc00030a2a0)
/go/pkg/mod/github.com/panjf2000/ants/[email protected]/worker_func.go:68 +0xb0
created by github.com/panjf2000/ants/v2.(*goWorkerWithFunc).run
/go/pkg/mod/github.com/panjf2000/ants/[email protected]/worker_func.go:48 +0x4c
文档里面没找到这个设置的具体说明?
我刚开始以为是 http代理的用户名和密码认证
但是 实践的时候发现
加了 Basic 认证用户名 和密码 就会提示 ssl:default [远程计算机拒绝网络连接。]
而且log里面没找到相关的内容.
希望能够得到解答,谢谢
添加客户端接口 POST /client/add/
1、API 增加客户端没有返回ID(无法自动返回拿到ID,需要再查询所有ID,然后筛选出来刚新增的ID)
需求:
响应携带 ID
希望能提供自增长的客户端webAPI新增接口。每次可以返回跟原有ID不重复的ID.
2、域名解析列表获取接口,不能指定客户端ID下的域名列表。(仅通过搜索来筛选)
Server : 服务端版本 0.26.14
Clent: 0.26.14
Clent Docer Bug Info:
2023/01/12 16:25:26.568 [I] [npc.go:231] the version of client is 0.26.14, the core version of client is 0.26.0
2023/01/12 16:25:26.569 [I] [control.go:97] Loading configuration file conf/npc.conf successfully
2023/01/12 16:25:27.648 [E] [control.go:235] The client does not match the server version. The current core version of the client is 0.26.0
panic: runtime error: invalid memory address or nil pointer dereference
[
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
客户端导航:点开后左侧客户端列表,点开能够看到这个ID下面的所有tcp、域名解析等。客户端ID可以设置自动停用时间
一个域名对多个端口的问题,或者一个域名可以快速多条不同端口的穿透
2022/10/31 01:12:28 worker with func exits from a panic: runtime error: invalid memory address or nil pointer dereference
2022/10/31 01:12:28 worker with func exits from panic: goroutine 240 [running]:
github.com/panjf2000/ants/v2.(*goWorkerWithFunc).run.func1.1(0xc000202a80)
/go/pkg/mod/github.com/panjf2000/ants/[email protected]/worker_func.go:58 +0x165
panic(0xa66500, 0xf62ce0)
/usr/local/go/src/runtime/panic.go:969 +0x1b9
ehang.io/nps/lib/file.(*Flow).Add(0x0, 0x81, 0x81)
/go/src/ehang.io/nps/lib/file/obj.go:21 +0x33
ehang.io/nps/lib/goroutine.CopyBuffer(0x7f714146f008, 0xc00000d4a0, 0xbd9920, 0xc0000a00c0, 0x0, 0x0, 0xc0000a2670, 0xe, 0x0, 0x0)
/go/src/ehang.io/nps/lib/goroutine/pool.go:81 +0x2db
ehang.io/nps/lib/goroutine.copyConnGroup(0xad7d00, 0xc0002930e0)
/go/src/ehang.io/nps/lib/goroutine/pool.go:114 +0x15d
github.com/panjf2000/ants/v2.(*goWorkerWithFunc).run.func1(0xc000202a80)
/go/pkg/mod/github.com/panjf2000/ants/[email protected]/worker_func.go:68 +0xb0
created by github.com/panjf2000/ants/v2.(*goWorkerWithFunc).run
/go/pkg/mod/github.com/panjf2000/ants/[email protected]/worker_func.go:48 +0x4c
也不见单核跑满,但是速度最高只有600k,换X64机器能跑好几M。。。
我的想通过调取API的方式来统计流量(因为我有好几个服务器需要统计 所以我想自己写一个脚本 进行流量分析 毕竟我不可能一个一个的进后台)
(希望得到各位支持 谢谢谢谢🙏)
希望能在tcp隧道中获取真实ip
可以增加客户端和服务端连接使用tls加密这个功能吗
不知道哪里出现的问题
当我直接试用nps start的时候,一切正常(web后台和内网穿透均正常)
但是我试用nps命令启动的时候,web后台正常,但是内网穿透有问题
这是截图:
https://s1.ax1x.com/2022/11/22/z1G64x.png
以下是我的配置文件
appname = nps
#Boot mode(dev|pro)
runmode = pro
##bridge
# 底层通信协议,默认tcp,可选用kcp
bridge_type=tcp
# 底层通信端口,默认8024,如已被占用请指定其他端口
bridge_port=7000
bridge_ip=0.0.0.0
# 当客户端以配置文件模式启动时会用到的验证密钥,可自行设置,本教程不会使用到
public_vkey=
#Traffic data persistence interval(minute)
#Ignorance means no persistence
flow_store_interval=1
# log level LevelEmergency->0 LevelAlert->1 LevelCritical->2 LevelError->3 LevelWarning->4 LevelNotice->5 LevelInformational->6 LevelDebug->7
log_level=6
log_path=nps.log
#Whether to restrict IP access, true or false or ignore
#ip_limit=true
#p2p
#p2p_ip=127.0.0.1
#p2p_port=6000
#web
web_host=nps.xxx*****.cn
web_username=*8*****
web_password=**********5
web_port = 8001
web_ip=0.0.0.0
web_base_url=
web_open_ssl=true
web_cert_file=/root/conf/server.pem
web_key_file=/root/conf/server.key
# if web under proxy use sub path. like http://host/nps need this.
#web_base_url=/nps
#Web API unauthenticated IP address(the len of auth_crypt_key must be 16)
#Remove comments if needed
#auth_key=test
auth_crypt_key =1234567812345678
#allow_ports=9001-9009,10001,11000-12000
#Web management multi-user login
allow_user_login=false
allow_user_register=false
allow_user_change_username=false
#extension
#流量限制
allow_flow_limit=true
#带宽限制
allow_rate_limit=true
#客户端最大隧道数限制
allow_tunnel_num_limit=true
allow_local_proxy=false
#客户端最大连接数
allow_connection_num_limit=true
#每个隧道监听不同的服务端端口
allow_multi_ip=true
system_info_display=true
#获取用户真实ip
http_add_origin_header=true
#cache
http_cache=false
http_cache_length=100
#get origin ip
http_add_origin_header=false
#pprof debug options
#pprof_ip=0.0.0.0
#pprof_port=9999
#client disconnect timeout
disconnect_timeout=60
#管理面板开启验证码校验
open_captcha=true
通常server端可能也有web服务需要暴露出来,如果nps占用了80的话,需要能反向代理服务器上的其他http服务
原版本的逻辑登录鉴权漏洞修复了吗
现在最新版大概前后可以往前支持多少版本的客户端?
另外,可否可以支持ipv6? 如果可以ipv6声明一下地址,有很多服务可以直连过去。
在ehang-io的版本中
执行./nps install 是可以被systemctrl控制的
但是在up fork版本中似乎没有这个功能了
debian11 x64
0.26.11版本号编译的时候没有修改
服务端版本:v0.26.12.3
客户端版本:v0.26.12.3
操作:
在腾讯云服务器上安装服务端版本,开放了8424(桥接端口),9090(web端口)
在windows下直接使用npc.exe文件,不使用配置,执行以下命令
npc.exe -server=公网ip:8424 -vkey=uskbvdubfff08f02 -type=tcp
配置文件:
最后结果是这样的,超时,并且web界面未连接
宝塔端口放行
腾讯云端口放行
希望能得到大佬的解答,真心搞不懂,搞了大半个月了。
域名解析只打开https的时候,希望通过https进行访问,可以添加http重定向https吗。nps管理页面也希望有重定向
检查更新时得到的结果是主分支的版本,反而倒退回去了,建议将检查更新和下载更新的连接改为此分支的release
毕竟配置了好多东西在这里
要是搞个用户到期时间控制就完美了
如果前置了Cloudflare或者Nginx的proxy_pass , websocket 会报错误400。
能否指点一下问题出在哪里?
我是小白一个,请问一下你更新的nps怎么使用?我需要websocket功能,我没找到安装包什么的?👍
下载过程中只有26.13版本客户端不被微软杀毒报毒
连接后客户端提示:
[46f73f7a2b954e16b7c8e375d9355b77](client.go:63] The connection server failed and will be reconnected in five seconds, error read tcp 10.2.28.8:40784->101.2.188.54:8080: wsarecv: An existing connection was forcibly closed by the remote host.)
如何规避这样的问题。
很想提供支持,奈何我不会go,学了一点,但是也只限于刚刚会
希望能够修改用户注册默认带宽流量客户端数量等参数
s390x架构Ubuntu平台上没有,自己用源码编译错误,希望作者能提供,谢谢
Is your feature request related to a problem? Please describe.
现有nps无法转发WOL魔术桢
Describe the solution you'd like
正常转发WOL魔术桢
Describe alternatives you've considered
None
Additional context
None
2022/10/28 10:57:21.590 [I] [bridge.go:198] Current client connection validation error, close this client: 122.96.144.253:60106
2022/10/28 10:57:21.949 [I] [bridge.go:198] Current client connection validation error, close this client: 218.2.107.245:12045
2022/10/28 10:57:26.692 [I] [bridge.go:198] Current client connection validation error, close this client: 122.96.144.253:60109
2022/10/28 10:57:27.047 [I] [bridge.go:198] Current client connection validation error, close this client: 218.2.107.245:28158
公司的网络只有ipv4,用客户端连不上服务端,家里的网络能正常连接,有方法解决吗?
无法复现呐小哥,你用的是http还是tcp协议,这二种协议都试过吗
Originally posted by @yisier in #9 (comment)
执行文件路径:/mnt/mmcblk0p1/app/nps/nps
配置文件路径:/mnt/mmcblk0p1/app/nps/conf/nps.conf
在其他目录启动输入 /mnt/mmcblk0p1/app/nps/nps
会提示
2023/01/12 11:38:47 load config file error the target config file: conf/nps.conf don't exist
不知道什么原因,就是特别卡,重启服务,关闭客户端连接都无用,创建了5个客户端,隧道总数不到20个
原因:使用nps将公网服务器的9000端口转发到内网的远程桌面。但是运行一段时间后就会发现有一个IP再不断的爆破这个900端口,参考大量的非法url 攻击的方式,想尝试在nps外面加nginx,在nginx里面使用allow和deny来对IP进行处理。我的配置目前如下,
stream{
upstream windows{
hash $remote_addr consistent;
server 127.0.0.1:9000 max_fails=3 fail_timeout=10s;
}
server{
listen 8000;
proxy_connect_timeout 20s;
proxy_timeout 5m;
proxy_pass windows;
}
}
但是这样在npc客户端中显示的访问ip永远都是127.0.0.1,假如再次有非法IP爆破端口我无法知道他的真实ip。
问题:如果使用nginx的反代方式,如何知道爆破方的真实IP?
或者nps有什么方法可以限制或者允许指定IP吗?(因为使用的人较复杂,所以只通过一个IP或者一个IP cidr无法满足要求,需要支持多个IP cidr的设置)
每次要多个人用一个都会显示端口已占用
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.