Websockets using Ruby Eventmachine. HTML5 is loaded with a lot of features that will make the lives of developers much easier and the experience for end users more pleasant as well. Lets take a look one of the new features: WebSockets. We'll make the magic happen with Ruby's EventMachine gem. Mash Some Keys! If you're in a browser that supports WebSockets (Chrome, Safari, Firefox trunk), go ahead and type a bit. Your keystrokes will be captured, and broadcasted to any other users on the page. If this page is lonely, you can open a second browser window to test it out. Setting Up EventMachine Using EventMachine for WebSockets is simple with the em-websockets gem.
Require 'eventmachine'require 'em-websocket' @sockets = []EventMachine.run do EventMachine::WebSocket.start(:host => '0.0.0.0', :port => 8080) do |socket| socket.onopen do @sockets << socket end socket.onmessage do |mess| @sockets.each {|s| s.send mess} end socket.onclose do @sockets.delete socket end endend Client Side. HTML5 Boilerplate - A rock-solid default template for HTML5 awesome. HTML5. This specification defines the 5th major version, second minor revision of the core language of the World Wide Web: the Hypertext Markup Language (HTML).
In this version, new features continue to be introduced to help Web application authors, new elements continue to be introduced based on research into prevailing authoring practices, and special attention continues to be given to defining clear conformance criteria for user agents in an effort to improve interoperability. This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at This document was published by the Web Platform Working Group as a W3C Recommendation for HTML 5.2 that would obsolete the HTML 5.1 Recommendation.
This document was produced by a group operating under the W3C Patent Policy. The W3C Markup Validation Service. HTML5. A vocabulary and associated APIs for HTML and XHTML Editor's Draft 28 September 2012 Latest Published Version: Latest Editor's Draft: Previous Versions: Editors: Robin Berjon , W3C Travis Leithead , Microsoft Silvia Pfeiffer Erika Doyle Navara , Microsoft Edward O'Connor , Apple Inc. Previous Editor: Ian Hickson , Google, Inc. Copyright © 2012 W3C ® ( MIT , ERCIM , Keio ), All Rights Reserved. Abstract 1.3 Scope. HTML5: Edition for Web Authors. This document is a strict subset of the full HTML5 specification that omits user-agent (UA) implementation details. It is targeted toward Web authors and others who are not UA implementors and who want a view of the HTML specification that focuses more precisely on details relevant to using the HTML language to create Web documents and Web applications.
Because this document does not provide implementation conformance criteria, UA implementors should not rely on it, but should instead refer to the full HTML5 specification. This document is an automated redaction of the full HTML5 specification. As such, the two documents are supposed to agree on normative matters concerning Web authors. However, if the documents disagree, this is a bug in the redaction process and the unredacted full HTML specification takes precedence. Readers are encouraged to report such discrepancies as bugs in the bug tracking system of the HTML Working Group. This is a work in progress! HTML Standard. Web Hypertext Application Technology Working Group. HTML5 — Edition for Web Developers.