googollee / go-socket.io

socket.io library for golang, a realtime application framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not working OnEvent Method with return string

sshaplygin opened this issue · comments

Describe the bug
Expect similar behaviour for double methods: OnEvent with Emit and OnEvent with return string

To Reproduce
use simple example from https://github.com/socketio/chat-example

server.OnEvent("/", "chat message", func(s socketio.Conn, msg string) {
	s.Emit("chat message", "have: "+msg)
})

server.OnEvent("/", "chat message", func(s socketio.Conn, msg string) string {
	return "recv " + msg
})

client accept message by websocket, but it doesn't output by ui. maybe problem into socketio js. client 

Expected behavior
server in event with return must be working.

Environment (please complete the following information):

  • Go version: [v1.19]
  • Server version [master - 913e8c2]
  • Client version [v1.7.4]

Additional context
Add any other context about the problem here.