GithubHelp home page GithubHelp logo

yisier / nps Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ehang-io/nps

1.6K 22.0 195.0 9.14 MB

在 0.26.10 版本的基础上修改而来的

Home Page: https://ehang.io/nps/documents

License: GNU General Public License v3.0

Shell 2.74% Go 97.02% Makefile 0.23%
nps go http https tcp udp

nps's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nps's Issues

客户端 ID 问题

遇到几个问题不知道是正常:

  • web操作,客户端暂停后原客户端ID被释放,但绑定的隧道的客户端ID确没有变动,如果隧道过多就需要一个一个手动去修改才能正常使用。
  • web操作暂停客户端后,状态和连接还是显示开放和在线,而暂停隧道界面却显示正常。

Basic 认证用户名 这个干嘛用的?

文档里面没找到这个设置的具体说明?
我刚开始以为是 http代理的用户名和密码认证
但是 实践的时候发现
加了 Basic 认证用户名 和密码 就会提示 ssl:default [远程计算机拒绝网络连接。]
而且log里面没找到相关的内容.
希望能够得到解答,谢谢

校园网拦截npc客户端的连接

连接后客户端提示:
[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.)

如何规避这样的问题。

一些需求

客户端导航:点开后左侧客户端列表,点开能够看到这个ID下面的所有tcp、域名解析等。客户端ID可以设置自动停用时间

一个域名对多个端口的问题,或者一个域名可以快速多条不同端口的穿透

客户端无法连接服务端,提示超时

服务端版本:v0.26.12.3
客户端版本:v0.26.12.3

操作:
在腾讯云服务器上安装服务端版本,开放了8424(桥接端口),9090(web端口)
在windows下直接使用npc.exe文件,不使用配置,执行以下命令
npc.exe -server=公网ip:8424 -vkey=uskbvdubfff08f02 -type=tcp
配置文件:
image

最后结果是这样的,超时,并且web界面未连接
image
宝塔端口放行
image
腾讯云端口放行
image

希望能得到大佬的解答,真心搞不懂,搞了大半个月了。

TCP隧道+nginx反代时如何获取真实IP

原因:使用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的设置)

在外部路径启动时会找不到配置文件

执行文件路径:/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

可以添加http重定向到https吗

域名解析只打开https的时候,希望通过https进行访问,可以添加http重定向https吗。nps管理页面也希望有重定向

请问怎么使用?

我是小白一个,请问一下你更新的nps怎么使用?我需要websocket功能,我没找到安装包什么的?👍

websocket报错

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

WakeOnLan魔术桢

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

改完存储位置后映射访问报错,改动在PR中

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

P2P模式不是真实的点对点,依然需要服务端转发,并且受服务器带宽限制,希望修复

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Opening '...'
  2. Click on '....'
  3. See error

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):

  • OS: [e.g. Centos, Windows]
  • ARCH: [e.g. Amd64, Arm]
  • Tunnel [e.g. TCP, HTTP]
  • Version [e.g. 0.24.0]

Client (please complete the following information):

  • OS: [e.g. Centos, Windows]
  • ARCH: [e.g. Amd64, Arm]
  • Tunnel [e.g. TCP, HTTP]
  • Version [e.g. 0.24.0]

Additional context
Add any other context about the problem here.

是否能添加一个 用于查询 流量统计数据的API

我的想通过调取API的方式来统计流量(因为我有好几个服务器需要统计 所以我想自己写一个脚本 进行流量分析 毕竟我不可能一个一个的进后台)

(希望得到各位支持 谢谢谢谢🙏)

web Basic 认证

希望能改进一下Basic 认证功能,主要是在编辑客户端开启了Basic 认证功能,底下所有Web都进行了认证加密,这点很不方便,有些站点须要加密认证,有些不要,能不能在新增WEB页面里添加Basic 认证功能,这样可以有选择

可以考虑一下出npc安卓版吗,如果可以的话,能不能加上p2p连接功能

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.

NPC -Docker - 遇到了内核提示0.26.0,但是我装了0.26.14

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
[

请问有docker的npc吗?

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如何安装?报错当前连接验证错误

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

image

android 服务端和客户端支持

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.

通过API 增加客户端没有返回ID

添加客户端接口 POST /client/add/

1、API 增加客户端没有返回ID(无法自动返回拿到ID,需要再查询所有ID,然后筛选出来刚新增的ID)
需求:
响应携带 ID
希望能提供自增长的客户端webAPI新增接口。每次可以返回跟原有ID不重复的ID.

2、域名解析列表获取接口,不能指定客户端ID下的域名列表。(仅通过搜索来筛选)

域名解析通道异常

使用域名解析映射内网服务时;
当浏览器已经打开过nps本身映射的页面后,再不重启浏览器的情况下,继续访问其他三级域名时,显示的内容只会是nps。
目前遇到过会出现类型情况的服务器页面有 nps本身页面、pfSecse管理页面、bitwarden密码管理页面。
当已经打开过上述页面后,只能重启浏览器才能打开映射的其他的域名。
image

多个客户端配置可以写在一个config文件内吗?

我的NAS上跑了不同的容器应用,有多个应用需要通过NPS以域名解析的方式穿透出内网。目前我是在NAS上跑了N个NPC容器来分别连接NPS实现不同的应用域名解析穿透,可以将这些写在一个NPC的config配置文件中,以实现只要启动一个NPC客户端,就可以完成所有的连接吗?
image
image

tls加密

可以增加客户端和服务端连接使用tls加密这个功能吗

命令:nps start和nps的问题

不知道哪里出现的问题
当我直接试用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

很想提供支持

很想提供支持,奈何我不会go,学了一点,但是也只限于刚刚会

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.