是否可以让 socket.io 客户端响应所有事件而不必单独指定每个事件?
例如,这样的事情(现在显然行不通):
var socket = io.connect("http://myserver");
socket.on("*", function(){
// listen to any and all events that are emitted from the
// socket.io back-end server, and handle them here.
// is this possible? how can i do this?
});
我希望在客户端 socket.io 代码接收到任何/所有事件时调用此回调函数。
这可能吗?如何?