socket.io:
socket.on("message",function(msg){ })
socket.on("privite",function(msg){})
allows ws to distinguish between different message events like this:
wss.on("connection", function connection(ws,t) {
ws.on("message1", function (message) {})
ws.on("message2", function (message) {})
....
the client uses HTML5 WebSocket, but the htms5 WebSocket event method can only send messages by ws.send (data), so how to define message events