Browse Source

feature: add -l flag to use localhost

make_cert_optional
Otto Suess 7 years ago
parent
commit
62ef92ba01
No known key found for this signature in database GPG Key ID: 354749C62B4BAC41
  1. 1
      README.md
  2. 1
      config.go
  3. 2
      zapconnect.go

1
README.md

@ -21,6 +21,7 @@ zapconnect
```
-i, --localip Use local ip instead of public ip.
-l, --localhost Use 127.0.0.1 for ip.
-j, --json Display json instead of a QRCode.
--lnddir= The base directory that contains lnd's data, logs, configuration
file, etc.

1
config.go

@ -31,6 +31,7 @@ var (
// loading+parsing process.
type config struct {
LocalIp bool `short:"i" long:"localip" description:"Include local ip in QRCode."`
Localhost bool `short:"l" long:"localhost" description:"Use 127.0.0.1 for ip."`
Json bool `short:"j" long:"json" description:"Generate json instead of a QRCode."`
LndDir string `long:"lnddir" description:"The base directory that contains lnd's data, logs, configuration file, etc."`
ConfigFile string `long:"C" long:"configfile" description:"Path to configuration file"`

2
zapconnect.go

@ -82,6 +82,8 @@ func main() {
ipString := ""
if loadedConfig.LocalIp {
ipString = getLocalIP() + ":10009"
} else if loadedConfig.Localhost {
ipString = "127.0.0.1:10009"
} else {
ipString = getPublicIP() + ":10009"
}

Loading…
Cancel
Save