client\service.go:
1.取消重连
keepControllerWorking()
2.增加Pritoken: svr.cfg.Pritoken,
loginMsg := &msg.Login{
cmd\frps\root.go:
1.tokenAuthUrl string 定义常量
portCheckUrl string
2.初始化常量
rootCmd.PersistentFlags().StringVarP(&tokenAuthUrl, "token_auth_url", "", "", "token auth url")
rootCmd.PersistentFlags().StringVarP(&portCheckUrl, "port_check_url", "", "", "port check url")
3.
parseServerCommonCfgFromCmd() ....
cfg.TokenAuthUrl = tokenAuthUrl
cfg.PortCheckUrl = portCheckUrl
conf\frpc.ini:
增加pritoken
conf\frps.ini
增加
token_auth_url = http://127.0.0.1:8080/tunnel/token/check?token=
port_check_url = http://127.0.0.1:8080/tunnel/port/check
\models\config\client_common.go
增加
Token string `json:"token"`
Pritoken string `json:"pritoken"`
\models\config\server_common.go
TokenAuthUrl string `json:"token_auth_url"`
PortCheckUrl string `json:"port_check_url"`
\models\msg\msg.go
Pritoken string `json:"pritoken"`
\server\proxy\tcp.go
判断逻辑:访问port_check_url返回ok
\server\service.go
判断逻辑:访问port_check_url返回ok