I’m doing chat system with nodejs. To create a node server I can either use net or http module. So what is the difference and benefit of using each of them ?
I’m doing chat system with nodejs . To create a node server I can
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
httpis built on top ofnet(which handles the TCP layer underlying HTTP).I imagine that your “chat system” will have browser-based clients, since node.js isn’t great for GUIs/desktop apps at the moment. If that’s the case, you’ll most likely want to use
http.A node.js chat server has already been made – node-chat. You could build yours on top of this, or take a look at its source code for some ideas.