WebSockets: The Real-Time Web, Delivered
WebSockets: The Real-Time Web, Delivered
Whiteboard Demo
Get
FireFox 7 Alpha
http://www.mozilla.com/refox/channel/
The Problem
No
API Simplicity TCP is a stream-oriented protocol We want a message-oriented protocol Security Scan a Local Network DDOS Attack
WebSocket Drafts
Started at WhatWG WhatWG Draft-75 (old browsers) WhatWG Draft-76 (Chrome, Safari) Moved to IETF HyBi - HyperText Bi-directional Working Group Draft-00 (Same as WhatWG Draft-76) Draft-07 (FireFox 6 beta) Draft-09 (FireFox 7 alpha)
Built on HTTP Traverse existing proxies/intermediaries Co-exist on same port with HTTP/HTTPS
server
handling via Sec-WebSocket-Origin Sec-WebSocket-Key Validation Prevent cross-protocol attacks Fail early if a dumb intermediary provides a cached response. Sec- headers prevent XHR from being used to contact a WebSocket server
Cross-Origin
contentious issue in the HyBi Working Group. All client-to-server messages are masked. Why is this necessary? Prevent cache-poisoning attacks Prevent talking to overly permissive servers Concern over this issue caused some browser vendors to pull support for WebSockets draft-76.
does it work? Randomly generated four-byte mask key per frame Applied using XOR to frame payload compression efciency for client-to-server messages
Reduces
frame types:
OPCODE
7-BIT LENGTH
Byte 2
OPCODE
Byte 2
Byte 3
Byte 4
OPCODE
Byte 2
Server Implementations
Node.JS: WebSocket-Node https://github.com/Worlize/WebSocket-Node ANSI C: libwebsockets http://git.warmcat.com/cgi-bin/cgit/libwebsockets/ Java:
Jetty
http://webtide.intalio.com/2011/04/getting-started-with-websockets/
Client Implementations
Node.JS: WebSocket-Node https://github.com/Worlize/WebSocket-Node ActionScript 3: AS3WebSocket https://github.com/Worlize/AS3WebSocket ANSI C: libwebsockets http://git.warmcat.com/cgi-bin/cgit/libwebsockets/
Demo
Shared Whiteboard Example
Available