mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 03:16:53 +00:00
Merge branch 'dev' of https://ehang.io/nps into dev
This commit is contained in:
@@ -36,6 +36,7 @@ var (
|
||||
logPath = flag.String("log_path", "", "npc log path")
|
||||
debug = flag.Bool("debug", true, "npc debug")
|
||||
pprofAddr = flag.String("pprof", "", "PProf debug addr (ip:port)")
|
||||
stunAddr = flag.String("stun_addr", "stun.stunprotocol.org:3478", "stun server address (eg:stun.stunprotocol.org:3478)")
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -107,7 +108,9 @@ func main() {
|
||||
install.UpdateNpc()
|
||||
return
|
||||
case "nat":
|
||||
nat, host, err := stun.NewClient().Discover()
|
||||
c := stun.NewClient()
|
||||
c.SetServerAddr(*stunAddr)
|
||||
nat, host, err := c.Discover()
|
||||
if err != nil || host == nil {
|
||||
logs.Error("get nat type error", err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user