From 2803b41186ab479a9d980fe084e3c59472b7c077 Mon Sep 17 00:00:00 2001 From: Marco Date: Sun, 18 Dec 2022 15:43:27 +0100 Subject: [PATCH] Test hostname() function. --- main.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 548a973..ed2e505 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,7 @@ import ( "log" "mchess_server/server" "net/http" + "os" ) var cert_path = "/etc/letsencrypt/live/chess.sw-gross.de/" @@ -12,9 +13,19 @@ var key_file = cert_path + "privkey.pem" func main() { + hostname, err := os.Hostname() + if err != nil { + log.Println(err) + } + + log.Println(hostname) + http.HandleFunc("/", server.SocketHandler) - err := http.ListenAndServeTLS("wogehtspam.:8080", cert_file, key_file, nil) + log.Println("Cert file: ", cert_file) + log.Println("Key file: ", key_file) + + err = http.ListenAndServeTLS(":8080", cert_file, key_file, nil) if err != nil { log.Println(err) }