summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2026-09-08 19:06:01 -0700
committerRose Hogenson <rosehogenson@posteo.net>2026-09-08 19:06:10 -0700
commit8ec63bd25fd63f9e89db935bb94e056c633d83f5 (patch)
tree1c39bd85ac92347624865de8c5b1ed86758c9f80
parentGet rid of port and domain flags (diff)
downloadroseh.moe-8ec63bd25fd63f9e89db935bb94e056c633d83f5.tar.zst
Pick default port
-rw-r--r--roseh.moe.go9
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))