mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
feat(nathole): add flag for STUN server in nathole discovery command (#3383)
This commit is contained in:
parent
3faae194d0
commit
2c2c4ecdbc
@ -26,11 +26,15 @@ import (
|
|||||||
"github.com/fatedier/frp/pkg/nathole"
|
"github.com/fatedier/frp/pkg/nathole"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var natHoleSTUNServer string
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
RegisterCommonFlags(natholeCmd)
|
RegisterCommonFlags(natholeCmd)
|
||||||
|
|
||||||
rootCmd.AddCommand(natholeCmd)
|
rootCmd.AddCommand(natholeCmd)
|
||||||
natholeCmd.AddCommand(natholeDiscoveryCmd)
|
natholeCmd.AddCommand(natholeDiscoveryCmd)
|
||||||
|
|
||||||
|
natholeCmd.PersistentFlags().StringVarP(&natHoleSTUNServer, "nat_hole_stun_server", "", "", "STUN server address for nathole")
|
||||||
}
|
}
|
||||||
|
|
||||||
var natholeCmd = &cobra.Command{
|
var natholeCmd = &cobra.Command{
|
||||||
@ -47,6 +51,9 @@ var natholeDiscoveryCmd = &cobra.Command{
|
|||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
if natHoleSTUNServer != "" {
|
||||||
|
cfg.NatHoleSTUNServer = natHoleSTUNServer
|
||||||
|
}
|
||||||
|
|
||||||
if err := validateForNatHoleDiscovery(cfg); err != nil {
|
if err := validateForNatHoleDiscovery(cfg); err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user