diff --git a/main.go b/main.go index 1deba8a..0ef423a 100644 --- a/main.go +++ b/main.go @@ -27,7 +27,7 @@ func main() { defer db.DisconnectDB() // Start WebSocket server - http.Handle("/", websocket.Handler(server.Handler)) + http.Handle("/", websocket.Handler(server.Listener)) fmt.Println("WebSocket server started on", config.Server.Address) err = http.ListenAndServe(config.Server.Address, nil) if err != nil { diff --git a/server/server.go b/server/relay.go similarity index 99% rename from server/server.go rename to server/relay.go index 2854453..85c20f4 100644 --- a/server/server.go +++ b/server/relay.go @@ -14,7 +14,7 @@ import ( var subscriptions = make(map[string]server.Subscription) -func Handler(ws *websocket.Conn) { +func Listener(ws *websocket.Conn) { defer ws.Close() var msg string