書(shū)名: Web Penetration Testing with Kali Linux(Third Edition)作者名: Gilberto Najera Gutierrez Juned Ahmed Ansari本章字?jǐn)?shù): 126字更新時(shí)間: 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.
推薦閱讀
- Learning OpenDaylight
- 操作系統(tǒng)基礎(chǔ)與實(shí)踐:基于openEuler平臺(tái)
- Windows Server 2012 Hyper-V Cookbook
- 精解Windows8
- Linux網(wǎng)絡(luò)內(nèi)核分析與開(kāi)發(fā)
- 數(shù)據(jù)中心系統(tǒng)工程及應(yīng)用
- 奔跑吧 Linux內(nèi)核(入門(mén)篇)
- Ceph分布式存儲(chǔ)實(shí)戰(zhàn)
- 一學(xué)就會(huì):Windows Vista應(yīng)用完全自學(xué)手冊(cè)
- Hands-On UX Design for Developers
- Social Data Visualization with HTML5 and JavaScript
- Linux基礎(chǔ)使用與案例
- Learning Continuous Integration with Jenkins(Second Edition)
- 統(tǒng)信UOS應(yīng)用開(kāi)發(fā)進(jìn)階教程
- 嵌入式微系統(tǒng)