-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
emitting to a room doesn't work for namespaced clients #285
Comments
Yes we need better testing for room joins + messages On Jun 23, 2011, at 1:31 PM, dvv wrote:
|
https://github.com/LearnBoost/Socket.IO-node/blob/master/lib/socket.js#L131 sets https://github.com/LearnBoost/Socket.IO-node/blob/master/lib/namespace.js#L84 scrambles everything, should set only |
Fix landed in master |
This bug appears to no longer be fixed. I'm using: |
This is broken for me also. |
I did notice that broadcast to rooms joined via namespace does go out but without namespace. Quickest suggested fix would be to also add 'in' functions to namespace so we can broadcast to a room in context of a namespace. |
The socket.join() method prepends its This seems to be causing some confusion and makes it hard to join a room from another namespace: ns1 = io.of('/main')
ns2 = io.of('/chat')
ns1.on 'connect', (socket) ->
# Socket joins room: '/main/myroom'
socket.join 'myroom'
# A hack to join room: '/chat/myroom'
socket.namespace = ns2
socket.join 'myroom'
socket.namespace = ns1 It would be nice if you could specify the namespace to use when joining a room |
Any updates on this? Can this be re-opened as a bug? I'm also unable to broadcast to rooms within a namespace. |
It still doesn´t work in 1.2.1 |
doesnt work on 1.3.6 |
@missinglink you last reply here was like 2 years ago but anyway, did you find any solution? i just posted in stackoverflow something related. Please take a look and reply if possible. Ty http://stackoverflow.com/questions/34279278/join-a-namespace-room-from-different-namespace |
Still not solved in 2018! socket.io 2.1.0, why?! |
I figured it out. Basically, when emitting to namespaced rooms you also need to define the namespace. io.of('/chat').in( 'cool room' ).emit( 'new message' ); |
Failing
Working
The text was updated successfully, but these errors were encountered: