Files
tma-back/controllers/ws.go
Smile Rex 1bb1e3bfd4
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 3m25s
fix
2026-01-21 13:10:15 +03:00

23 lines
354 B
Go

package controllers
import (
"log"
"net/http"
"github.com/gorilla/websocket"
)
func (h *Hub) ws(w http.ResponseWriter, r *http.Request) {
upgrader := websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool { return true },
}
conn, err := upgrader.Upgrade(w, r, nil)
if err != nil {
log.Println(err)
return
}
go h.readLoop(conn)
}