- Web Penetration Testing with Kali Linux(Third Edition)
- Gilberto Najera Gutierrez Juned Ahmed Ansari
- 126字
- 2021-06-24 18:44:56
WebSockets
HTTP is a stateless protocol as noted previously. This means that a new connection is established for every request and closed after every response. An HTML5 WebSocket is a communication interface that allows for a permanent bidirectional connection between client and server.
A WebSocket is opened by the client through a GET request such as the following:
GET /chat HTTP/1.1 Host: server.example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw== Sec-WebSocket-Protocol: chat, superchat Sec-WebSocket-Version: 13 Origin: http://example.com
If the server understands the request and accepts the connection, its response would be as follows:
HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk= Sec-WebSocket-Protocol: chat
The HTTP connection is then replaced by the WebSocket connection, and it becomes a bidirectional binary protocol not necessarily compatible with HTTP.
推薦閱讀
- 零起點學Linux系統管理
- Designing Purpose:Built Drones for Ardupilot Pixhawk 2.1
- FreeRTOS實時內核應用指南
- 精解Windows 8
- 混沌工程:復雜系統韌性實現之道
- Alfresco 4 Enterprise Content Management Implementation
- 巧學活用Windows 7
- Cassandra 3.x High Availability(Second Edition)
- μC/OS-III內核實現與應用開發實戰指南:基于STM32
- iOS 10快速開發:18天零基礎開發一個商業應用
- Learn OpenShift
- Linux系統管理初學者指南:基于CentOS 7.6
- Drupal 7 Mobile Web Development Beginner’s Guide
- Linux應用大全 服務器架設
- Windows 10入門與提高