nps可以说是用户界面做的最好的,安装也是非常的简单!
nps是一款轻量级、功能强大的内网穿透代理服务器。
支持tcp、udp流量转发,支持内网http代理、内网socks5代理,同时支持snappy压缩、站点保护、加密传输、多路复用、header修改等。
尤其是支持web图形化管理,集成多用户模式,这个比frp要好很多!
准备
公网服务器(centos,服务端),公网Ip,没准备域名。 本地服务器(centos,客户端)
# 云服务器
ip 1.1.1.1 # 自己服务器IP,端口开放看需求
开放端口: 8024,10000(自定义管理页端口),9200(自定义需求,映射tcp服务端口)
# 本地服务器
192.168.31.94
# 另外
nps默认配置文件使用了80,443,8080,8024端口
80与443端口为域名解析模式默认端口
8080为web管理访问端口
8024为网桥端口,用于客户端与服务器通信
nps地址
https://github.com/ehang-io/nps/releases
1. 服务器下载
# 2024年github没更新
wget https://github.com/ehang-io/nps/releases/download/v0.26.10/linux_amd64_server.tar.gz
# windows
https://github.com/ehang-io/nps/releases/download/v0.26.10/windows_amd64_server.tar.gz
- 客户端(本地服务器,本地Windows等)
# 看自己系统,本地用centos 使用 linux
wget https://github.com/ehang-io/nps/releases/download/v0.26.10/linux_amd64_client.tar.gz
# windows
https://github.com/ehang-io/nps/releases/download/v0.26.10/windows_amd64_client.tar.gz
- 服务器安装
# 解压文件
tar -xzvf linux_amd64_server.tar.gz
# 解压后文件目录
conf # 配置目录
nps # 执行文件
web # 前端
- 修改配置文件(安装前修改,安装后这个文件在 、/etc/nps/ 目录下,再次修改可能无效)
vim conf/nps.conf
appname = nps
#Boot mode(dev|pro)
runmode = dev
#HTTP(S) proxy port, no startup if empty
http_proxy_ip=0.0.0.0 # 有域名改域名
http_proxy_port=80 # 域名代理http代理监听端口
https_proxy_port=443 # 域名代理https代理监听端口
https_just_proxy=true
#default https certificate setting
https_default_cert_file=conf/server.pem
https_default_key_file=conf/server.key
##bridge
bridge_type=tcp
bridge_port=8024 # 内网服务的监听端口,如有冲突,在客户端修改
bridge_ip=0.0.0.0
#web
web_host=a.o.com # 有域名改域名
web_username=admin # 管理页面账户
web_password=admin2022 # 管理页密码
web_port = 10000 # 自定义的管理页端口
web_ip=0.0.0.0
web_base_url=
web_open_ssl=false
web_cert_file=conf/server.pem
web_key_file=conf/server.key
5.安装和启动服务端
# 先安装
#linux
./nps install
# 启动
# windwos
nps.exe install
#LINUX
sudo nps start
# windows管理员身份运行cmd,进入程序目录
nps.exe start
如果发现没有启动成功,可以查看日志(Windows日志文件位于当前运行目录下,linux和darwin位于/var/log/nps.log
- 管理页配置
新增一个客户端
打开客户端
复制客户端命令
./npc -server=1.1.1.1:8024 -vkey=1234567 -type=tcp
5.安装客户端
解压包 。。略
# 安装
./npc install -server=1.1.1.1:8024 -vkey=1234567 -type=tcp
# 启动
npc start
# 停止
npc stop
6.开启内网穿透
进入隧道
新增隧道