diff --git a/cmd/server/main.go b/cmd/server/main.go index ebcee49..e97a17d 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -38,7 +38,7 @@ func Start() { listen := fmt.Sprintf("%s:%d", serverConfig.ListenAddress, serverConfig.ListenPort) - http.HandleFunc("/ws", websocket.HandleConnections) + http.HandleFunc("/ws", websocket.HandleConnection) go websocket.SendPermanentBroadCastMessage() log.Info("GoTomato started", "version", metadata.GoTomatoVersion) diff --git a/internal/websocket/handle_connections.go b/internal/websocket/handle_connection.go similarity index 86% rename from internal/websocket/handle_connections.go rename to internal/websocket/handle_connection.go index 4b5f1b1..707bea8 100644 --- a/internal/websocket/handle_connections.go +++ b/internal/websocket/handle_connection.go @@ -18,8 +18,8 @@ var upgrader = websocket.Upgrader{ CheckOrigin: func(r *http.Request) bool { return true }, } -// HandleConnections upgrades HTTP requests to WebSocket connections and manages the client lifecycle. -func HandleConnections(w http.ResponseWriter, r *http.Request) { +// HandleConnection upgrades HTTP requests to WebSocket connections and manages the client lifecycle. +func HandleConnection(w http.ResponseWriter, r *http.Request) { // Upgrade initial GET request to a WebSocket ws, err := upgrader.Upgrade(w, r, nil) if err != nil {