diff options
-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)) +} |