开发者

nodejs - net or http module

开发者 https://www.devze.com 2023-02-28 06:42 出处:网络
I\'m doing chat system with nodejs. 开发者_如何学PythonTo create a node server I can either use net or http module. So what is the difference and benefit of using each of them ?http is built on top of

I'm doing chat system with nodejs. 开发者_如何学PythonTo create a node server I can either use net or http module. So what is the difference and benefit of using each of them ?


http is built on top of net (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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号