WebSocket learning summary
RecentlyIfinishtoreadonebookabouthtml5websocket.Followingsaresomesummaryfrommylearningprogress.
HTML5coversthelargenumberofimprovementsandchangeshappeninginwebtechnologies,andincludeseverythingfromthemarkupyouuseonyourwebpagestotheCSS3styling,offlineandstorage,multimedia,connectivity,andsoon.
"TheConnectivityareaofHTML5includestechnologieslikeWebSocket,Server-SentEvents,andCross-DocumentMessaging".
- WebSocketispartoftheHTML5.NamelyConnectivitysectionoftheHTML5specificationincludesWebSocket.
- WebSocketisnaturallyfull-duplex,bidirectionalsingle-socketconnection.
- Withwebsocket,Httprequestbecomesasinglerequesttoopenawebsocketconnectionusinghandshakeprocess,lateryoucanreusetheconnectionfromclienttoserverandfromservertoclient.
- WebSocketAPI:events:open,message,error,close.
methods:send
attribute:readyState(0oponning,1open,2closing,3closed)
attribute:bufferedAmount,protocol
WebSocketProtocalrequestfromclient:GET/echoHTTP/1.1
Host:echo.websocket.org
Origin:http://www.websocket.org
Sec-WebSocket-Key:7+C600xYybOv2zmJ69RQsw==
Sec-WebSocket-Version:13
Upgrade:websocket
responsefromserver:
101SwitchingProtocols
Connection:Upgrade
Date:Wed,20Jun201203:39:49GMT
Sec-WebSocket-Accept:fYoqiH14DgI+5ylEMwM2sOLzOi0=
Server:KaazingGateway
Upgrade:WebSocket
UsingmessagingoverWebSocketwithXMPPUsingmessagingoverWebSocketwithSTOMPWebSocketsecurityusingTLS(SSL)overTCP.