基本上,标准是否允许这种互动? (Python伪代码:)
import socket
s = socket.create_connection((host, 80))
s.send("GET /index.html HTTP/1.1\nHost:example.com\nConnection:keep-alive\n\n")
s.recv() // Should be a 200
s.send("GET /websocket HTTP/1.1\nHost:example.com\nUpgrade: websocket\nConnection: Upgrade\n\n")
s.recv() // Should be 101