Skip to content

Commit

Permalink
update log entry for ws con
Browse files Browse the repository at this point in the history
  • Loading branch information
sagostin committed Oct 4, 2024
1 parent 06b72fe commit 11f7f21
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web/ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ func getWebsocketEvents(r *Router) websocket.Namespaces {
"agent": websocket.Events{
websocket.OnNamespaceConnected: func(nsConn *websocket.NSConn, msg websocket.Message) error {
// with `websocket.GetContext` you can retrieve the Iris' `Context`.
ctx := websocket.GetContext(nsConn.Conn)
//ctx := websocket.GetContext(nsConn.Conn)

log.Infof("[%s] connected to namespace [%s] with IP [%s]",
nsConn, msg.Namespace,
ctx.Values().GetString("client_ip"))
log.Infof("[%s] connected to namespace [%s]", /* with IP [%s]""*/
nsConn, msg.Namespace, /*,
ctx.Values().GetString("client_ip")*/)
return nil
},
websocket.OnNamespaceDisconnect: func(nsConn *websocket.NSConn, msg websocket.Message) error {
Expand Down

0 comments on commit 11f7f21

Please sign in to comment.