From 2567ed22becdc83c90e129c228b31f75b1438758 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Tue, 9 Jul 2019 12:25:06 +0300 Subject: [PATCH] minor example fixes Former-commit-id: 163652ddfad00300590fbe6798cf9761a8e4b5e6 --- _examples/mvc/websocket/main.go | 4 ++-- _examples/websocket/basic/server.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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)