Skip to content

Default room name is not socket id #2475

Closed
@tw0517tw

Description

@tw0517tw

I'm using socket.io 1.4.5.

if I do

io.to(socketId).emit('some msg');

the message will not be emitted.

after digging a little bit I found that I should prepend /# before socke id.

socketRoomName = '/#' + socketId;
io.to(socketRoomName).emit('some msg');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions