diff options
| -rw-r--r-- | roseh.moe.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/roseh.moe.go b/roseh.moe.go index 7fd4ebd..5ca646d 100644 --- a/roseh.moe.go +++ b/roseh.moe.go @@ -1139,7 +1139,14 @@ func main() { cgitCGI.PathLocationHandler = cgitCGI http.Handle("code."+selfURL.Hostname()+"/", cgitCGI) - addr := ":" + selfURL.Port() + port := selfURL.Port() + if port == "" { + port = "80" + if *https != "" { + port = "443" + } + } + addr := ":" + port log.Printf("Listening on %q", addr) if *https != "" { log.Fatal(http.ListenAndServeTLS(addr, *https+"/cert.pem", *https+"/key.pem", nil)) |
