diff options
author | Joop Kiefte <ikojba@gmail.com> | 2020-07-13 07:18:19 +0200 |
---|---|---|
committer | Joop Kiefte <ikojba@gmail.com> | 2020-07-13 07:18:19 +0200 |
commit | 669c28c3e85e4a8fc8c291401e8fee48617e81a3 (patch) | |
tree | 8e7f4a288de6efa4d517bf27d6cd42bb6031a201 | |
parent | 15b0088830c4e61e7dc93661f07eed03a4e26963 (diff) |
-rw-r--r-- | main.go | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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)) +} |