mirror of
https://github.com/fatedier/frp.git
synced 2024-11-07 16:44:29 +01: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"
|
||||
)
|
||||
|
||||
var natHoleSTUNServer string
|
||||
|
||||
func init() {
|
||||
RegisterCommonFlags(natholeCmd)
|
||||
|
||||
rootCmd.AddCommand(natholeCmd)
|
||||
natholeCmd.AddCommand(natholeDiscoveryCmd)
|
||||
|
||||
natholeCmd.PersistentFlags().StringVarP(&natHoleSTUNServer, "nat_hole_stun_server", "", "", "STUN server address for nathole")
|
||||
}
|
||||
|
||||
var natholeCmd = &cobra.Command{
|
||||
@ -47,6 +51,9 @@ var natholeDiscoveryCmd = &cobra.Command{
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
if natHoleSTUNServer != "" {
|
||||
cfg.NatHoleSTUNServer = natHoleSTUNServer
|
||||
}
|
||||
|
||||
if err := validateForNatHoleDiscovery(cfg); err != nil {
|
||||
fmt.Println(err)
|
||||
|
Loading…
Reference in New Issue
Block a user