GitHub:https://github.com/ehang-io/nps

下载和安装NPS服务端

#下载并解压客户端(注意:如果有必要记得修改版本号和架构)
wget https://github.com/cnlh/nps/releases/download/v0.26.10/linux_amd64_server.tar.gz && tar zxvf  linux_amd64_server.tar.gz
#编辑配置文件
cd nps
chmod +x nps
nano conf/nps.conf 

#为了方便后续在任意目录使用,先运行主程序进行"安装" (你可以在安装之前就修改好配置文件nps.conf)
(我刚开始没安装启动总报错)
xfox@HK:~/nps_server$ ./nps start 2021/06/23
22:05:06.917 [E] [nps.go:132] Valid actions: ["start" "stop"
"restart" "install" "uninstall"] Failed to start nps内网穿透代理服务器: exit
status 4 xfox@HK:~/nps_server$ sudo ./nps start
[sudo] password for xfox: 2021/06/23 22:05:46.610 [E] [nps.go:132]
Valid actions: ["start" "stop" "restart" "install" "uninstall"] Failed
to start nps内网穿透代理服务器: exit status 5
sudo ./nps install
2021/06/23 22:06:58 copy file
::/home/xfox/nps_server/conf/clients.json to /etc/nps/conf/clients.json 2021/06/23 22:06:58 copy file
::/home/xfox/nps_server/conf/hosts.json to /etc/nps/conf/hosts.json
2021/06/23 22:06:58 copy file ::/home/xfox/nps_server/conf/nps.conf to /etc/nps/conf/nps.conf 2021/06/23 22:06:58 copy file
2021/06/23 22:06:58 copy file
这里的执行日志字符太多被我吞了
::/home/xfox/nps_server/web/static/webfonts/fa-solid-900.woff2 to /etc/nps/web/static/webfonts/fa-solid-900.woff2 2021/06/23 22:06:58
install ok! 2021/06/23 22:06:58 Static files and configuration files
in the current directory will be useless 2021/06/23 22:06:58 The new configuration file is located in /etc/nps you can edit them 2021/06/23
22:06:58 You can start with: nps start|stop|restart|uninstall|update or nps-update update anywhere!
#接下来启动NPS即可
nps start

NPS配置文件部分参数说明

copy自:[MoeWah]官方文档
名称 含义
web_port web管理端口
web_password web界面管理密码
web_username web界面管理账号
web_base_url web管理主路径,用于将web管理置于代理子路径后面
bridge_port 服务端客户端通信端口
https_proxy_port 域名代理https代理监听端口
http_proxy_port 域名代理http代理监听端口
auth_key web api密钥
bridge_type 客户端与服务端连接方式kcp或tcp
public_vkey 客户端以配置文件模式启动时的密钥,设置为空表示关闭客户端配置文件连接模式
ip_limit 是否限制ip访问,true或false或忽略
flow_store_interval 服务端流量数据持久化间隔,单位分钟,忽略表示不持久化
log_level 日志输出级别
auth_crypt_key 获取服务端authKey时的aes加密密钥,16位
p2p_ip 服务端Ip,使用p2p模式必填
p2p_port p2p模式开启的udp端口
pprof_ip debug pprof 服务端ip
pprof_port debug pprof 端口
disconnect_timeout 客户端连接超时,单位 5s,默认值 60,即 300s = 5mins

标签: none

添加新评论