- Modern JavaScript Applications
- Narayan Prusty
- 226字
- 2021-07-14 11:02:32
Chapter 5. Bidirectional Communication in Real Time
We have been using COMET techniques to implement bidirectional communication between a web browser and web server. Long polling is the most popular technique of achieving bidirectional communication between a web browser and web server because it works without compromising user experience and without any extra server configuration, and it works on all web browsers that support AJAX. Long polling can easily be implemented in any existing HTTP server. But the problem with long polling and other comet techniques is that none of them are suitable for building real-time apps because of HTTP overhead. This means that every time an HTTP request is made, a bunch of headers and cookie data is transferred to the server, which in turn increases the latency, therefore making it unsuitable for creating applications such as multiplayer games, chat apps, social networks, and live score websites, which require bidirectional communication in real time. Therefore, a new protocol called WebSocket was introduced, which was designed to enable bidirectional communication in real time between a web browser and WebSocket server.
In this chapter, we'll cover the following:
- An overview of WebSocket
- The relationship between WebSocket and HTTP
- The interaction of WebSocket with proxy servers and firewalls
- Implementing WebSocket using Socket.IO
- The Socket.IO API in depth
- Many other important things related to WebSocket and Socket.IO
- 從程序員到架構師:大數據量、緩存、高并發、微服務、多團隊協同等核心場景實戰
- Blockly創意趣味編程
- Visual C++串口通信技術詳解(第2版)
- 深度強化學習算法與實踐:基于PyTorch的實現
- 算法訓練營:提高篇(全彩版)
- Ext JS 4 Web Application Development Cookbook
- QGIS By Example
- Spring Boot企業級項目開發實戰
- Teaching with Google Classroom
- 蘋果的產品設計之道:創建優秀產品、服務和用戶體驗的七個原則
- Python商務數據分析(微課版)
- C#面向對象程序設計(第2版)
- Python 3快速入門與實戰
- HTML5/CSS3/JavaScript技術大全
- 歐姆龍PLC編程指令與梯形圖快速入門