3 ms·
Yeah, I have absolutely no idea why Web Sockets aren't just an initial HTTP request and then a protocol switch (Upgrade header); that would work for the vast ma
by TimothyFitz 17y ago
Yeah, I have absolutely no idea why Web Sockets aren't just an initial HTTP request and then a protocol switch (Upgrade header); that would work for the vast majority of proxies and make cookies/same domain/etc work seamlessly.
- mcav 17y agoFrom the web socket spec: The protocol has two parts: a handshake, and then the data transfer. The handshake from the client looks as follows: GET /demo HTTP/1.1 Upgrade: WebSocket Connection: Upgrade Host: example.com Origin: http://example.com WebSocket-Protocol: sample The handshake from the server looks as follows: HTTP/1.1 101 Web Socket Protocol Handshake Upgrade: WebSocket Connection: Upgrade WebSocket-Origin: http://example.com WebSocket-Location: ws://example.com/demo WebSocket-Protocol: sample
- TimothyFitz 17y agoWell, that explains my disbelief. Thanks!