diff --git a/client/cli.go b/client/cli.go index cc8f4a90..56778fa6 100644 --- a/client/cli.go +++ b/client/cli.go @@ -46,6 +46,7 @@ type Options struct { subdomain string command string inspectaddr string + serveraddr string inspectpublic bool tls bool tlsClientCrt string @@ -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, @@ -136,6 +142,7 @@ func ParseArgs() (opts *Options, err error) { protocol: *protocol, authtoken: *authtoken, hostname: *hostname, + serveraddr: *serveraddr, inspectaddr: *inspectaddr, inspectpublic: *inspectpublic, tls: *tls, diff --git a/client/config.go b/client/config.go index 0ba1fa4a..6b445bea 100644 --- a/client/config.go +++ b/client/config.go @@ -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 }