官术网_书友最值得收藏!

Chapter 2. Extending Our Development with Socket.IO

In the last chapter, we built a simple web application that can serve HTML pages. Let's add some more functionality to our application. We have to build a chat app, so we will need some sort of real-time event framework. Luckily for us, there is Socket.IO, which will provide us with this real-time communication. Socket.IO fits right into the entire evented nature of Node.js. The whole paradigm of Socket.IO is completely different from using a web server. Socket.IO uses WebSockets to create a connection between the server and client. You will need to understand all this to get Socket.IO to do what you want it to. In this chapter, we will cover the following topics:

  • Sending and receiving events
  • Creating rooms to divide users
  • Adding and reading data from sessions
  • Authenticating connections
  • Integrating Socket.IO with what we have built already
主站蜘蛛池模板: 鄂伦春自治旗| 佛山市| 紫云| 文山县| 磐石市| 郓城县| 施甸县| 丁青县| 丰原市| 平武县| 岚皋县| 张家川| 洪湖市| 滨州市| 瓮安县| 南华县| 宣武区| 北川| 东丽区| 台东市| 秦安县| 利川市| 太和县| 吉隆县| 巫溪县| 昌乐县| 法库县| 从江县| 滕州市| 锡林郭勒盟| 永安市| 琼中| 罗平县| 新乡县| 新晃| 兴山县| 宣武区| 商南县| 阳朔县| 大石桥市| 洛扎县|