after onopen and before onclose (ws.readyState must match WebSocket.OPEN) close() : terminates connection (send may still work until onclose). Two optional params, status code and reason
e s t f r o m t h e C l i e n t G E T / e c h o H T T P / 1 . 1 H o s t : e c h o . w e b s o c k e t . o r g O r i g i n : h t t p : / / w w w . w e b s o c k e t . o r g S e c - W e b S o c k e t - K e y : 7 + C 6 0 0 x Y y b O v 2 z m J 6 9 R Q s w = = S e c - W e b S o c k e t - V e r s i o n : 1 3 U p g r a d e : w e b s o c k e t H T T P R e s p o n s e f r o m t h e S e r v e r 1 0 1 S w i t c h i n g P r o t o c o l s C o n n e c t i o n : U p g r a d e D a t e : W e d , 2 0 J u n 2 0 1 2 0 3 : 3 9 : 4 9 G M T S e c - W e b S o c k e t - A c c e p t : f Y o q i H 1 4 D g I + 5 y l E M w M 2 s O L z O i 0 = S e r v e r : K a a z i n g G a t e w a y U p g r a d e : W e b S o c k e t
considerations protocol-based auth is still a bit complicated extra connections for server communication simplified API / some features aren't exposed handshake still initiated by browser addressing is still one-directional problems for document-centric web? indexing? accessibility?