Render chat messages that come over the socket

This commit is contained in:
Gabe Kangas
2022-05-03 13:01:50 -07:00
parent 15becc5121
commit 8b07eb7457
5 changed files with 21 additions and 15 deletions

View File

@@ -183,7 +183,12 @@ func (s *Server) HandleClientConnection(w http.ResponseWriter, r *http.Request)
_, _ = w.Write([]byte(events.ErrorMaxConnectionsExceeded))
return
}
upgrader.CheckOrigin = func(r *http.Request) bool { return true }
// To allow dev web environments to connect.
upgrader.CheckOrigin = func(r *http.Request) bool {
return true
}
conn, err := upgrader.Upgrade(w, r, nil)
if err != nil {
log.Debugln(err)