frpc: support nathole discover (#3381)

This commit is contained in:
fatedier
2023-03-30 20:28:15 +08:00
committed by GitHub
parent 9800b4cfcf
commit a22d6c9504
13 changed files with 521 additions and 17 deletions

View File

@ -293,7 +293,7 @@ func NewService(cfg config.ServerCommonConf) (svr *Service, err error) {
if cfg.BindUDPPort > 0 {
var nc *nathole.Controller
address := net.JoinHostPort(cfg.BindAddr, strconv.Itoa(cfg.BindUDPPort))
nc, err = nathole.NewController(address)
nc, err = nathole.NewController(address, []byte(cfg.Token))
if err != nil {
err = fmt.Errorf("create nat hole controller error, %v", err)
return