WebSocket: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
ValterVBot (discussione | contributi)
m Handshake del protocollo: tag source deprecati, replaced: <source lang= → <syntaxhighlight lang= (2), </source> → </syntaxhighlight> (2)
Riga 11:
 
Richiesta del client:
<sourcesyntaxhighlight lang="text">
GET /mychat HTTP/1.1
Host: server.example.com
Riga 20:
Sec-WebSocket-Version: 13
Origin: http://example.com
</syntaxhighlight>
</source>
 
Risposta del server:
<sourcesyntaxhighlight lang="text">
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Riga 29:
Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk=
Sec-WebSocket-Protocol: chat
</syntaxhighlight>
</source>
 
L'handshake ricorda l'implementazione HTTP così il server può gestirla come una normale richiesta di connessione sulla stessa porta. All'interno della richiesta vengono specificati degli opportuni campi che identificano una richiesta Websocket.