Skip to content
This repository has been archived by the owner on Dec 17, 2022. It is now read-only.

Commit

Permalink
added custom server addr on each call
Browse files Browse the repository at this point in the history
  • Loading branch information
jerson committed Feb 6, 2021
1 parent f3909f6 commit 30adbb4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type Options struct {
subdomain string
command string
inspectaddr string
serveraddr string
inspectpublic bool
tls bool
tlsClientCrt string
Expand Down Expand Up @@ -115,6 +116,11 @@ func ParseArgs() (opts *Options, err error) {
"",
"Path to a TLS Client Key file if server requires")

serveraddr := flag.String(
"serveraddr",
defaultServerAddr,
"The addr for server")

inspectaddr := flag.String(
"inspectaddr",
defaultInspectAddr,
Expand All @@ -136,6 +142,7 @@ func ParseArgs() (opts *Options, err error) {
protocol: *protocol,
authtoken: *authtoken,
hostname: *hostname,
serveraddr: *serveraddr,
inspectaddr: *inspectaddr,
inspectpublic: *inspectpublic,
tls: *tls,
Expand Down
4 changes: 4 additions & 0 deletions client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ func LoadConfiguration(opts *Options) (config *Configuration, err error) {
config.ServerAddr = defaultServerAddr
}

if opts.serveraddr != "" {
config.ServerAddr = opts.serveraddr
}

if opts.inspectaddr != "" {
config.InspectAddr = opts.inspectaddr
}
Expand Down

0 comments on commit 30adbb4

Please sign in to comment.