I am working on a chat application using express.js and socket.io. I want to create a button which if the user clicks, he is asked for a username and then he is redirected to the chat page. I am not sure about how to structure this app. Basically how do i redirect to the chat page after user selects a username and how do i use that username on the chat page? Should i put socket handlers on both pages and separate handlers for both on the server side as well? I think i am getting confused on using url routing with sockets. Please help.
I could my code here but at this stage it is really not much more than what any basic socket.io tutorial provides.
via doctorsherlock
No comments:
Post a Comment