需求
由于本地调试网页需要,通过内网穿透可以避免建项目挂在服务器上调试
资料
软件下载安装
服务器为centos,下载安装inux_amd64_server.tar.gz
下载后,解压,然后执行;
1、sudo ./nps install
2、sudo nps start
nps后台管理
nps配置文件路径
/etc/nps/conf
conf里面
#web
web_host=你的公网ip
web_username=admin
web_password=123
web_port=8080
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
#web_base_url=/nps
nps运行后,然后进入后台管理页面
地址 http://你的ip:8080
账号 admin
密码 123
添加客户端
配置
增加tunnel
然后通过你的 http://你的公网ip:8900就可以访问
安装客户端
Windows下载地址 nps
下载后解压
cmd切换到当前目录,去服务端查看命令
复制命令执行,既可以连接成功。
npc.exe -server=你的ip:8024 -vkey=你的key -type=tcp
至此配置完成
注意:过程中的端口必须都要打开防火墙
我配置过程中 用到 8024 8900 8080 80
8024:客户端与服务端通信端口有
8900:内网穿透访问端口
8080:后台登录端口
80:nps监听端口