This is a very old problem, but today I ran into this problem. I managed to use the built-in property addEventListeneras shown below.
ws.addEventListener('YourCustomEvent', (data) => {
// data.data contains your forwarded data
console.log(data.data)
})
Keep in mind that socketio has a special structure that needs to be analyzed manually when using HTML5 WebSockets.
message ( ..)
ws.addEventListener('message', (data) => {
// data.data contains your forwarded data
console.log(data.data)
})