Skip to content

Commit

Permalink
Enhanced configuration of CLI ARG
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielcoderX committed Sep 5, 2023
1 parent 0ebb4f2 commit 8055fd0
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,10 @@ func Copy(src io.Reader, dst io.Writer) {
}

func main() {
var ip string
var port string
flag.StringVar(&ip, "b", "0.0.0.0", "Server IP address")
flag.StringVar(&port, "p", "6666", "Server Port number")
var config Config
flag.StringVar(&config.Host, "b", "0.0.0.0", "Server IP address")
flag.StringVar(&config.Port, "p", "6666", "Server Port number")
flag.Parse()
server := New(&Config{
Host: ip,
Port: port,
})
server := New(&config)
server.Run()
}

0 comments on commit 8055fd0

Please sign in to comment.