WebSocket learning summary

Recently I finish to read one book about html5 websocket. Followings are some summary from my learning progress.

HTML5 covers the large number of improvements and changes happening in web technologies, and includes everything from the markup you use on your web pages to the CSS3 styling, offline and storage, multimedia,connectivity, and so on.

"The Connectivity area of HTML5 includes technologies like WebSocket, Server-Sent Events, and Cross-Document Messaging".
  1. WebSocket is part of the HTML5. Namely Connectivity section of the HTML5 specification includes WebSocket.
  2. WebSocket is naturally full-duplex, bidirectional single-socket connection.
  3. With websocket, Http request becomes a single request to open a websocket connection using handshake process, later you can reuse the connection from client to server and from server to client.
  4. WebSocket API:
  5.      events: open, message, error, close.
         methods: send
         attribute: readyState (0 oponning, 1 open, 2 closing, 3 closed)
         attribute: bufferedAmount, protocol
  6. WebSocket Protocal
  7.     request from client:
       
    GET /echo HTTP/1.1
    Host: echo.websocket.org
    Origin: http://www.websocket.org
    Sec-WebSocket-Key: 7+C600xYybOv2zmJ69RQsw==
    Sec-WebSocket-Version: 13
    Upgrade: websocket


        response from server:

    101 Switching Protocols
    Connection: Upgrade
    Date: Wed, 20 Jun 2012 03:39:49 GMT
    Sec-WebSocket-Accept: fYoqiH14DgI+5ylEMwM2sOLzOi0=
    Server: Kaazing Gateway
    Upgrade: WebSocket
  8. Using messaging over WebSocket with XMPP
  9. Using messaging over WebSocket with STOMP
  10. WebSocket security using TLS(SSL) over TCP.

你可能感兴趣的:(websocket)