What is the room name people are joining the chat, how to change it in socket io and read roomName from url?
FaizanZahid opened this issue · 0 comments
Great work and very nice tutorial.
-
I am trying to experiment this by having 2 users connected 1-1 instead of everyone in the same common room. How can i add 2 users in 1 room once both of them are on the page, if 3rd user comes, we put them on waiting and when 4th comes, 3rd and 4th are added to that room to have private chat? Kind of random 1-1 chat with 2 people at 1 time. i have checked your tutorial but couldn't find the room name where you are emitting message and join events, as per socket io, events are emitted in rooms, https://socket.io/docs/emit-cheatsheet/ how is your approach different here?
-
Alternatively to be simple, how can i put let's say room name in the url, so that it loads that specific room, for e.g if i put http://localhost:4200?room=typescript-chat-room this should load a room named, typescript-chat-room and if i do http://localhost:4200?room=angular-discussion then that should connect to the room named, 'angular discussion' and so on. Please help me point in the code where i can change the room in server and how can i pass it as a query param from frontend client? i'd like to contribute once i understand the basics via code for rooms logic.
-
Also, is there reconnection implemented if socket io looses connection , does this auto reconnect the users? As i see socket io looses lots of connectivity due to ping timeouts, transport errors etc, is there any way to reconnect the chat automatically due to any network failure without page refresh?
-
what steps would be needed to allow users to upload and share videos/images/audio msgs (files) in the chat? can u share with me some libraries or examples to do this? i m interested in doing this.