Skip to content

Commit

Permalink
Fix is-server being ignored in stun-multiplex
Browse files Browse the repository at this point in the history
Call `flag.Parse()` first to enable normal reading
of parameters
  • Loading branch information
gongluck authored and Sean-Der committed Aug 16, 2024
1 parent 95c14ef commit 8fc0695
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/stun-multiplex/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ func multiplex(conn *net.UDPConn, stunAddr net.Addr, stunConn io.Reader) {
var stunServer = flag.String("stun", "stun.l.google.com:19302", "STUN Server to use") //nolint:gochecknoglobals

func main() {
isServer := flag.Arg(0) == ""

flag.Parse()

isServer := flag.Arg(0) == ""

// Allocating local UDP socket that will be used both for STUN and
// our application data.
addr, err := net.ResolveUDPAddr("udp4", "0.0.0.0:0")
Expand Down

0 comments on commit 8fc0695

Please sign in to comment.