-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I want to use socket.onAnyOutgoing()
to calculate bytes of outgoing messages.
However, when I use a room and send a binary message, socket.onAnyOutgoing()
cannot receive it.
So, I cannot calculate correctly.
I can reproduce it with the following code.
To Reproduce
Socket.IO server version: 4.5.0
Server
io.on('connection', (socket: Socket) => {
socket.onAnyOutgoing((event: string, ...args: any[]) => {
console.log('onAnyOutgoing:', ...args)
})
socket.join('test')
socket.emit('message', 'hoge') // -> onAnyOutgoing: hoge
socket.emit('message', Buffer.from('hoge')) // -> onAnyOutgoing: <Buffer 68 6f 67 65>
io.to('test').emit('message', 'hoge') // -> onAnyOutgoing: hoge
io.to('test').emit('message', Buffer.from('hoge')) // -> onAnyOutgoing: { _placeholder: true, num: 0 }
})
Expected behavior
socket.onAnyOutgoing()
should receive correctly binary message when it uses room.
io.to('test').emit('message', Buffer.from('hoge')) // -> onAnyOutgoing: <Buffer 68 6f 67 65>
Platform:
- OS : Generic
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working