I have an app that is connected to my goserver using websocket . I used this code to create a websocket connection - https://github.com/gorilla/websocket/tree/master/examples/chat
http.HandleFunc("/ws", func(w http.ResponseWriter, r *http.Request) {
serveWs(hub, w, r)
})
http.HandleFunc("/post",BroadcastMessage())
In BroadcastMessage, send a []byte
to the hub's broadcast channel:
hub.broadcast <- message