nps 服务端安装和配置

jupiter
2021-01-28 / 0 评论 / 821 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2021年12月07日,已超过869天没有更新,若内容或图片失效,请留言反馈。

nps 服务端安装和配置

0.说明

1. 服务端安装和启动

1.1 下载安装所需文件

mkdir nps
cd nps
wget https://github.com/ehang-io/nps/releases/download/v0.26.9/linux_amd64_server.tar.gz

1.2 解压

tar xzvf linux_amd64_server.tar.gz

1.3 安装

./nps install

备注:

安装完成后相关配置文件和web文件夹位于/etc/nps中

1.4 修改相关配置

  • 注意:配置文件不是解压出来的文件夹中的conf文件,而是/etc/nps中的配置文件
  • 配置文件所在位置

image-20210128184034953

  • 打开配置文件
cd /etc/nps
cd conf
# 可以看到该文件夹中有一个nps.conf文件便是待修改的配置文件
vim 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 #vhttp端口
https_proxy_port=443 #vhttps端口
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 

# Public password, which clients can use to connect to the server
# After the connection, the server will be able to open relevant ports and parse related domain names according to its own configuration file.
public_vkey=123

#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=7
#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 #p2p隧道端口

#web
web_host=a.o.com
web_username=admin
web_password=123
web_port = 8080 #web管理端口
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
# 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=false
allow_rate_limit=false
allow_tunnel_num_limit=false
allow_local_proxy=false
allow_connection_num_limit=false
allow_multi_ip=false
system_info_display=false

#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
  • 保持配置文件

1.5 启动nps

nps start

2.服务端使用

2.1 登录后台,添加客户端

默认用户名:admin

默认密码:123

image-20210128190705575

image-20210128190846290

2.2 查看客户端连接命令

image-20210128191043398

2.3 客户端连接

见博客:nps客户端使用

连接上的状态如下图所示:

image-20210128191330172

3. 为客户端配置隧道

image-20210128200243262

TCP隧道

image-20210128200353107

然后通过`服务器IP:50080即可访问该`客户端位于60080端口的服务。

0

评论 (0)

打卡
取消