From 40851815856be18700387275161bc6cbc101adf3 Mon Sep 17 00:00:00 2001 From: axiu Date: Fri, 14 Jun 2024 10:42:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dnat=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=8C=87=E5=AE=9Astun=E6=9C=8D=E5=8A=A1=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/npc/npc.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/cmd/npc/npc.go b/cmd/npc/npc.go index 67900cc..9daea56 100644 --- a/cmd/npc/npc.go +++ b/cmd/npc/npc.go @@ -1,23 +1,24 @@ package main import ( - "ehang.io/nps/client" - "ehang.io/nps/lib/common" - "ehang.io/nps/lib/config" - "ehang.io/nps/lib/file" - "ehang.io/nps/lib/install" - "ehang.io/nps/lib/version" "flag" "fmt" - "github.com/astaxie/beego/logs" - "github.com/ccding/go-stun/stun" - "github.com/kardianos/service" "os" "os/exec" "runtime" "strings" "sync" "time" + + "ehang.io/nps/client" + "ehang.io/nps/lib/common" + "ehang.io/nps/lib/config" + "ehang.io/nps/lib/file" + "ehang.io/nps/lib/install" + "ehang.io/nps/lib/version" + "github.com/astaxie/beego/logs" + "github.com/ccding/go-stun/stun" + "github.com/kardianos/service" ) var ( @@ -116,6 +117,7 @@ func main() { return case "nat": c := stun.NewClient() + flag.CommandLine.Parse(os.Args[2:]) c.SetServerAddr(*stunAddr) nat, host, err := c.Discover() if err != nil || host == nil {