aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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))
+}