mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
feat(nathole): add flag for STUN server in nathole discovery command
This commit is contained in:
parent
3faae194d0
commit
2ff2223937
1 changed files with 7 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue