From 669c28c3e85e4a8fc8c291401e8fee48617e81a3 Mon Sep 17 00:00:00 2001 From: Joop Kiefte Date: Mon, 13 Jul 2020 07:18:19 +0200 Subject: Add first main.go stub --- main.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 main.go diff --git a/main.go b/main.go new file mode 100644 index 0000000..c396a0f --- /dev/null +++ b/main.go @@ -0,0 +1,21 @@ +package main + +import ( + "flag" + "net/http" +) + +func websocket(w http.ResponseWriter, r *http.Request) { + // TODO: https://yalantis.com/blog/how-to-build-websockets-in-go/ +} + +func main() { + var bind, port string + flag.StringVar(&bind, "bind", "0.0.0.0", "Bind to this server address") + flag.StringVar(&port, "port", "8081", "Listen on this port") + flag.Parse() + + http.HandleFunc("/ws", websocket) + + panic(http.ListenAndServe(bind+":"+port, nil)) +} -- cgit v1.2.3-70-g09d2