Replies: 1 comment
-
Any time you mention "namespaces" I think you mean "rooms". Namespaces are not for this, but rooms definitely are. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to make something that is easily explained as "chat roulette" was.
Idea:
You come to the site '/' - Socketio js emits an "initial event", server checks if there are other users (maintaining dictionary of users and namespaces) - returns user and redirects it to /randomUUID of namespace. I don't want to create any registered users or such, so I am creating random guid for each client and passing that to server in order to know and persist always the same user, even if it closes the browser and then comes back.
so I'd have here {'uuid':{users:1, user1: guid}}
When user 2 comes on the site -> it goes to the above randomUUID, and two of them are on the same chat
{'uuid':{users:2, user1: guid, user2:guid}}
When user 3 comes on site -> since namespace already have 2 users, a new random UUID is created and user is somehow pushed to second namespace.
{'uuid':{users:2, user1: guid, user2:guid}, 'uuid2':{users:1, user1: guid}
Here I wanted to use broadcast between them.
I am trying to figure out if this is possible with namespaces, or to say, how can I "transfer" user who emitted "socket.on("connect") to "hello hello, you are connected to namespace X, please communicate there."?
Beta Was this translation helpful? Give feedback.
All reactions