aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoop Kiefte <ikojba@gmail.com>2020-07-13 07:18:19 +0200
committerJoop Kiefte <ikojba@gmail.com>2020-07-13 07:18:19 +0200
commit669c28c3e85e4a8fc8c291401e8fee48617e81a3 (patch)
tree8e7f4a288de6efa4d517bf27d6cd42bb6031a201
parent15b0088830c4e61e7dc93661f07eed03a4e26963 (diff)
Add first main.go stubHEADmaster
-rw-r--r--main.go21
1 files changed, 21 insertions, 0 deletions
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))
+}