Skip to content

Commit

Permalink
Merge pull request #177 from axfinn/fix/nat_0614
Browse files Browse the repository at this point in the history
fix: 修复nat参数指定stun服务错误问题
  • Loading branch information
yisier authored Nov 7, 2024
2 parents 02d8c6b + 4085181 commit 700332e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions cmd/npc/npc.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
package main

import (
"flag"
"fmt"
"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"
"flag"
"fmt"
"github.com/astaxie/beego/logs"
"github.com/ccding/go-stun/stun"
"github.com/kardianos/service"
"os"
"os/exec"
"runtime"
"strings"
"sync"
"time"
)

var (
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 700332e

Please sign in to comment.