socket.io-deno icon indicating copy to clipboard operation
socket.io-deno copied to clipboard

Cannot access private nsp property on sockets

Open dbuschtoens opened this issue 2 years ago • 0 comments

According to the documentation, you should be able to access the namespace of a socket with socket.nsp

io.of(/^\/dynamic-\d+$/).on("connection", (socket) => {
  const namespace = socket.nsp;
});

However, in the Deno implementation of the Socket.IO server, this fails with Property nsp is private and only accessible within class 'Socket'..

This is because it is defined as readonly private in socket.io-deno while in socket.io it is just readonly.

dbuschtoens avatar Jul 14 '23 11:07 dbuschtoens