From 8ec63bd25fd63f9e89db935bb94e056c633d83f5 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Tue, 8 Sep 2026 19:06:01 -0700 Subject: Pick default port --- roseh.moe.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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)) -- cgit v1.3.1