parent
f741196640
commit
86cbc977b0
1 changed files with 9 additions and 8 deletions
17
main.go
17
main.go
|
|
@ -235,15 +235,16 @@ func main() {
|
||||||
scheme = "https"
|
scheme = "https"
|
||||||
}
|
}
|
||||||
url := fmt.Sprintf("%s://%s/#%s", scheme, domain, secret)
|
url := fmt.Sprintf("%s://%s/#%s", scheme, domain, secret)
|
||||||
readyMsg := "ready: " + url + "\n"
|
fmt.Println(url)
|
||||||
qrCode, _ := GenerateQRCode(url, TerminalSupportsColor(os.Stderr.Fd()))
|
if qrCode, err := GenerateQRCode(url, TerminalSupportsColor(os.Stdout.Fd())); err == nil {
|
||||||
readyMsg += qrCode
|
fmt.Print(qrCode)
|
||||||
if !tls {
|
} else {
|
||||||
readyMsg += ("" +
|
log.Printf("QR code error: %v", err)
|
||||||
"▌ WARNING: TLS is not enabled ▐\n" +
|
}
|
||||||
"▌Don't use in an untrusted network!▐\n")
|
if !tls {
|
||||||
|
fmt.Println("▌ WARNING: TLS is not enabled ▐")
|
||||||
|
fmt.Println("▌Don't use in an untrusted network!▐")
|
||||||
}
|
}
|
||||||
log.Print(readyMsg)
|
|
||||||
if tls {
|
if tls {
|
||||||
err = http.ServeTLS(listener, mux, certFile, keyFile)
|
err = http.ServeTLS(listener, mux, certFile, keyFile)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue