详解

服务器端(基本上同此前的nps部署)

主要是nps.conf的部分:注释掉http部分,然后修改客户端端口及web服务端口

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
#https_proxy_port=443
#https_just_proxy=true
#default https certificate setting
#https_default_cert_file=conf/server.pem
#https_default_key_file=conf/server.key

#这段http打头的是http默认设置,可以全注释掉,留下来容易出端口冲突

##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=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=127.0.0.1 #本地服务ip
web_username= #web管理端用户名
web_password= #web管理登录密码
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_key=123
#获取服务端authKey时的aes加密密钥,16位
auth_crypt_key =213

#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=false


# 是否开启tls
tls_enable=true
tls_bridge_port=8025

太多的详情可以参考这个 1 https://blog.runm.top/608.html

客户端

首先客户端要和服务器端版本保持大致一致

其次,客户端支持 注册服务 方式部署

npc.exe install -server=xxx.xx.xx.xx:8024 -vkey=xxxxxx -type=tcp

然后在windows服务找到nps内网穿透客户端,点击启动服务即可

1 https://www.cnblogs.com/miaoyou/p/17128797.html