- 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運維之道(第3版)
- Windows Vista基礎與應用精品教程
- Modern Web Testing with TestCafe
- 混沌工程:復雜系統韌性實現之道
- Linux運維最佳實踐
- 無蘋果不生活 The New iPad隨身寶典
- 計算機系統:基于x86+Linux平臺
- 操作系統分析
- UI設計手繪表現從入門到精通
- Linux應用大全 基礎與管理
- Multi-Cloud for Architects
- Java EE 7 Developer Handbook
- VMware vSphere 5.1 Cookbook
- OpenSolaris紅寶書
- Serverless Architectures with Kubernetes