diff --git a/_examples/mvc/websocket/main.go b/_examples/mvc/websocket/main.go index 9e611e38..82f32caf 100644 --- a/_examples/mvc/websocket/main.go +++ b/_examples/mvc/websocket/main.go @@ -86,12 +86,12 @@ func (c *websocketController) OnNamespaceConnected(msg neffos.Message) error { // visits++ newCount := increment() - // This will call the "OnVisit" event on all clients, including the current + // This will call the "OnVisit" event on all clients, including the current one, // with the 'newCount' variable. // // There are many ways that u can do it and faster, for example u can just send a new visitor // and client can increment itself, but here we are just "showcasing" the websocket controller. - c.Conn.Server().Broadcast(c, neffos.Message{ + c.Conn.Server().Broadcast(nil, neffos.Message{ Namespace: msg.Namespace, Event: "OnVisit", Body: []byte(fmt.Sprintf("%d", newCount)), diff --git a/_examples/websocket/basic/server.go b/_examples/websocket/basic/server.go index ab028ca6..38d09353 100644 --- a/_examples/websocket/basic/server.go +++ b/_examples/websocket/basic/server.go @@ -68,7 +68,7 @@ func main() { // serves the endpoint of ws://localhost:8080/echo websocketRoute := app.Get("/echo", websocket.Handler(websocketServer)) - j.Get() + if enableJWT { // Register the jwt middleware (on handshake): websocketRoute.Use(j.Serve)