Browse Source

Listen on any address

master
Tyler Sommer 2 years ago
parent
commit
d4e72f2816
Signed by: tyler-sommer GPG Key ID: C09C010500DBD008
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      cmd/eokvin/http.go

+ 2
- 2
cmd/eokvin/http.go View File

@ -48,7 +48,7 @@ const landingPageMarkup = `<!doctype html>
</html>`
func listenAndServeRedirect() error {
l := fmt.Sprintf("%s:%d", listenHost, listenPortHTTP)
l := fmt.Sprintf(":%d", listenPortHTTP)
srv := &http.Server{Addr: l, Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
redirectToCanonicalHost(w, r)
return
@ -57,7 +57,7 @@ func listenAndServeRedirect() error {
}
func listenAndServeTLS() error {
l := fmt.Sprintf("%s:%d", listenHost, listenPortHTTPS)
l := fmt.Sprintf(":%d", listenPortHTTPS)
srv := &http.Server{Addr: l, Handler: newServeMux()}
if tlsKeyFile == "" && tlsCertFile == "" {
hosts := append([]string{listenHost}, fmt.Sprintf("www.%s", listenHost))


Loading…
Cancel
Save