SlideShare a Scribd company logo
1 of 18
Download to read offline
© Peter R. Egli 2015
1/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
Peter R. Egli
INDIGOO.COM
OVERVIEW OF WEB BASED
SERVER PUSH TECHNOLOGIES
COMET, HTML5
WEBSOCKETS
© Peter R. Egli 2015
2/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
Contents
1. Server push technologies
2. HTML5 server events
3. WebSockets
4. Reverse HTTP
5. HTML5 overview
© Peter R. Egli 2015
3/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
1. Server push technologies (1/7)
Problem:
HTTP does not provide full bidirectional connections between client and server.
HTTP is a request-response protocol. Asynchronous messages from the HTTP server to the
client (server push) are not directly possible.
HTTP was intentionally designed as a simple request-response protocol.
This request-response scheme makes the server implementation simple, i.e. the server is
stateless and thus does not have to maintain session state for each client.
Over time different work-around techniques /solutions emerged to overcome this 'limitation' of
HTTP.
HTTP GET / POST
HTTP Response
HTTP message
Every message from the server to the
client requires a request beforehand.
The HTTP protocol does not allow
sending unsolicited messages from the
server to the client.
HTTP client HTTP server HTTP client HTTP server
© Peter R. Egli 2015
4/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
1. Server push technologies (2/7)
Overview of solutions for server-push (1/3):
Server
push
solutions
A. Multiple
HTTP
connections
B. Comet
programming
(umbrella term)
C. Solutions
with
HTML5
B.1.1
Streaming +
hidden iframe
B.1.2
Streaming
with XHR
B.1
Streaming
B.2
Long polling
B.2.1
XHR
long polling
B.2.2
Script tag
long polling
C.1
HTML5
server sent
events (SSE)
C.2
WebSockets
The client opens an HTTP connection
to the server, the server opens a
connection to the client.
Example: XMPP BOSH protocol.
Only for server
client events (is
not bidirectional).
Full bidirectional
connection
between
client and server.
Browser
dependent
behavior.
Browser
dependent
behavior.
No X-site
scripting (not
possible to access
another server).
Complicated
implementation.
Complicates server impl.
© Peter R. Egli 2015
5/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
Web server
1. Server push technologies (3/7)
B.1.1 Streaming with hidden iframe (aka «forever frame»)
The HTML page contains a hidden IFRAME element.
This IFRAME element is filled with a chunked HTML page (the page is thus indefinitely long, the
server can asynchronously send updates to the client).
The server updates contain HTML script tags with Javascript code that are asynchronously
executed on the client.
HTML page
<IFRAME style=
"display:none;">
<script>
…
</script>
Web server
Browser / web client
<script>
…
</script>
<script>
…
</script>
Javascript
engine
© Peter R. Egli 2015
6/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
1. Server push technologies (4/7)
B.1.2 Streaming with XHR
The XMLHttpRequest object in Javascript provides access to the HTTP connection in the client.
When a message arrives, the Javascript engine calls the onreadystatechange function.
Web server
HTML page
data
(e.g.
XML)
Web server
Browser / web client
data
(e.g.
XML)
data
(e.g.
XML)
Javascript
engine
<script>
xxx
</script>
<script language="Javascript">
function update() {
self.xmlHttpRequest.onreadystatechange = function() {
//to XML data processing here
//access to XML: self.xmlHttpReq.responseXML
}
}
</script>
© Peter R. Egli 2015
7/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
1. Server push technologies (5/7)
B.2.1 XMLHttpRequest with long polling
The client sends requests through the XMLHttpRequest Javascript object.
After each response, the client "rearms" the polling by sending a new request.
B.2.2 Script tag long polling:
Same techniques as above, but the script code is embedded in <script> tags that can be
filled with code from another second level domain.
Possible across different second level domains (X-site scripting), but poses a security problem.
HTTP request (XMLHttpRequest)
HTTP Response
An event on the server (data changed)
requires the server to send an
asynchronous update to the client.
T
HTTP request (XMLHttpRequest)Client (script) immediately
"rearms" the polling by
sending a new request.
T
HTTP Response
HTTP request (XMLHttpRequest)
Another server-side event
HTTP client HTTP server
© Peter R. Egli 2015
8/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
1. Server push technologies (6/7)
C.1 HTML5 server sent events (SSE):
HTML5 server sent events (SSE) are similar to web sockets. SSE allow the server to
asynchronously send data to the client.
SSE differ from web sockets in that they only allow serverclient communication.
Web server
HTML page
event data
(e.g.
JSON)
Web server
Browser / web client
event data
(e.g.
JSON)
event data
(e.g.
JSON)
Javascript
engine
<script>
xxx
</script>
<script language="Javascript">
var source = new EventSource('/serverevents/talk');
source.onmessage = function() {
document.getElementById('content').innerHTML += e.data
+ '<br/>';
}
}
</script>
© Peter R. Egli 2015
9/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
1. Server push technologies (7/7)
Higher layer protocols:
Higher layer protocols define commands and responses that can be used in a client-server application.
Examples:
1. Bayeux protocol (by Dojo foundation):
 Protocol on top of a comet-mechanism
supporting streaming & long-polling.
 Defines frames, commands and fields etc.
2. JSON-RPC:
 Protocol with 3 different message types that are mapped to HTTP: request, response, notification.
 Peer-to-peer protocol, both client and server can send asynchronous notifications.
 Different scenarios are possible:
Comet
HTTP
Bayeux
Comet
HTTP
Bayeux
Bayeux protocol
HTTP protocol
HTTP
JSON-RPC
HTTP
JSON-RPC Comet
HTTP
JSON-RPC
Comet
HTTP
JSON-RPC
Comet
HTTP
Bayeux
Comet
HTTP
Bayeux
JSON-RPC JSON-RPC
JSON-RPC directly on top of HTTP.
Fully bidirectional message
communication of JSON-RPC is
not possible.
Comet provides bidirectional
communication for JSON-RPC.
JSON-RPC messages are
mapped to Bayeux messaging
protocol.
© Peter R. Egli 2015
10/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
3. WebSockets (1/3)
History of HTML and WebSockets standards:
W3C WWW Council; official standards body for WWW standards.
WHATWG Web Hypertext Application Technology Working Group.
Community of people (not vendors) interested in evolving HTML.
Founded because the W3C XHTML WG was slow in making progress.
IETF Hybi IETF Hypertext Bidirectional WG. Responsible for WebSocket IETF draft / RFC.
1999
XHTML WG
WHATWG
HyBi
Published
W3C
standards
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2014
HTML
4.0
XHTML
1.0
XHTML
1.1
HTML5
Draft
HTML5
Final
Web
Appl. 1.0
XHTML2 WG
RIP
W3C HTML WG
WHATWG draft
adopted as
starting point
RFC6455
WebSocket standard
moved to HyBi
W3C HTML5
Recommendation
Oct. 28 2014
2011
© Peter R. Egli 2015
11/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
3. WebSockets (2/3):
The WebSocket protocol defines the procedures to upgrade a plain-vanilla HTTP-connection
to a fully bidirectional WebSocket transport connection.
The WebSocket Javascript API defines the functions that give access to the WebSocket layer.
• W3C is responsible for the WebSocket Javascript API standard.
• IETF is responsible for the WebSocket protocol standard.
• The WebSocket protocol standard is published as IETF RFC6455.
See also http://www.websocket.org/.
WebSocket
protocol
WebSocket
API http://dev.w3.org/html5/websockets/
http://tools.ietf.org/html/rfc6455
Javascript
script
WebSocket
protocol
WebSocket
API
Service
process
© Peter R. Egli 2015
12/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
Server acknowledges to upgrade to WebSocket.
The server confirms acceptance for upgrading
with the Sec-WebSocket-Accept field.
Application protocol (WebSocket subprotocol) that
the server selects.
3. WebSockets (3/3):
WebSocket handshake procedure for upgrading an HTTP connection:
The client sends a normal HTTP GET request, but requests to upgrade to a WebSocket
connection. Afterwards the connection remains active until it is closed and the client and
server can exchange messages based on an application protocol.
Client  server request (example from http://tools.ietf.org/html/rfc6455):
GET /chat HTTP/1.1
Host: server.example.com
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Origin: http://example.com
Sec-WebSocket-Protocol: chat, superchat
Sec-WebSocket-Version: 13
ServerClient response:
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: s3pPLMBiTxa…GzbK+xOo=
Sec-WebSocket-Protocol: chat
Upgrade to a WebSocket connection.
Security fields to protect the handshake
against man-in-the-middle attacks.
Application protocols that the client supports.
Standard HTTP method and Host field lines.
Field for protocol version checks.
© Peter R. Egli 2015
13/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
4. Reverse HTTP (1/5):
Problem:
In many cases (embedded) clients are not accessible (visible) from the Internet because they
are in a private network or behind a firewall with NAT (Network Address Translation). Thus it is
impossible to connect to the embedded web server of such a device with a web browser from
outside the private network.
N.B.: The mobile or embedded devices are able to connect to the Internet (outgoing
connections are possible if permitted by the firewall).
Network with private IP
addresses (RFC1918)
such as a mobile provider
network or a LAN.
Web browser for
accessing embedded or
mobile device.
Public Internet
FW with
NAT
Mobile and
embedded
devices with
private IP
addresses
192.168.10.2
192.168.10.3
192.168.10.4
Public IP address
(visible to web
browser)
Private network
20.20.30.1
MN
MN: Mobile Node
NAT: Network Address Translation
LAN: Local Area Network
FW: Firewall
© Peter R. Egli 2015
14/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
4. Reverse HTTP (2/5):
Solution 1: VPN
Through VPNs both the devices and the web browser are hooked into the same (private)
network (172.16.1.0/24 in the example below).
Provides security if combined with authentication and encryption.
More complex installation. Requires a VPN client on the devices.
Increased performance requirements on clients and servers (encryption, VPN protocol).
Solution 2: Port Forwarding
NAT firewall forwards port 80 to 192.168.10.2.
No additional gear required.
NAT firewall must be under control for adding the port forwarding rule.
Security concerns (open port).
LAN
172.16.1.0/24
Internet Private
network
172.16.1.2
20.30.40.50
VPN server
with public
IP address
30.20.30.1
192.168.10.2
172.16.1.3
LAN
172.16.1.0/24 Internet
Private
network
172.16.1.2
30.20.30.1
192.168.10.2
80
Device 'dials'
into VPN.
The Firewall forwards
requests to port 80 on the device.
MN
MN
FW with NAT
FW with NAT
© Peter R. Egli 2015
15/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
4. Reverse HTTP (3/5):
Solution 3: Reverse HTTP (1/3)
Reverse HTTP is an experimental protocol (see IETF draft http://tools.ietf.org/html/draft-
lentczner-rhttp-00) that allows HTTP client and server to switch roles (client becomes server and
vice versa). The firewall lets the packets pass since the mobile node opens the connection.
During connection setup, HTTP client and server switch roles (client becomes server and vice
versa).
No VPN required (security could be satisfied with HTTPs).
Can be combined with WebSockets or COMET protocols (see above) for server push.
Reverse HTTP proxy required (there are open source solutions such as yaler.org).
LAN
172.16.1.0/24
Internet Private
network
172.16.1.2
Reverse HTTP
proxy somewhere
in the Internet
30.20.30.1
192.168.10.2
20.30.40.50
MN
FW with NAT
© Peter R. Egli 2015
16/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
4. Reverse HTTP (4/5):
Solution 3: Reverse HTTP (2/3)
Message flow:
Browser Proxy MNFirewall
Register address:
POST /dev42 HTTP/1.1
Upgrade: PTTH/1.0
Connection: Upgrade
Host: devices.net
1
Proxy response:
HTTP/1.1 Switching Protocols
Upgrade: PTTH/1.0
Date: Sat, 10 Sept. 2011
Content-Length: 0
2
Proxy forwards request:
GET /dev42/res HTTP/1.1
Host: devices.net
4
Server response:
HTTP/1.1 OK
Data (XML, JSON)
5
Browser (client) request:
GET /dev42/res HTTP/1.1
Host: devices.net
3
Proxy forwards server response:
HTTP/1.1 OK
Data (XML, JSON)
6
ID Srv.
Conn.
… …
dev42 37
… …
© Peter R. Egli 2015
17/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
4. Reverse HTTP (5/5)
Solution 3: Reverse HTTP (3/3)
1. The mobile node registers with the proxy:
The mobile node opens an outgoing HTTP connection to the proxy (the proxy must be accessible both by the mobile node and
the web browser, so usually the proxy is somewhere in the Internet).
The URL in the POST request contains an ID of the client (dev42 in the example).
The mobile node requests to upgrade the connection to reverse HTTP with the HTTP header fields Upgrade: PTTH/1.0 and
Connection: Upgrade.
2. Proxy accepts the connection switch:
The proxy accepts the connection upgrade by responding with HTTP/1.1 Switching Protocols, Upgrade: PTTH/1.0.
The proxy adds the mobile client's ID (dev42) to its connection table (dev42 is accessible through HTTP connection 37).
From now on the proxy acts like an HTTP client while the mobile node is an HTTP server.
3. Browser request:
The user enters the URL http://www.devices.net/dev42/res in the browser in order to access the resource 'res' on the mobile
node. The host in the URL is the proxy's domain name address, so the browser sends the request to the proxy.
4. Proxy forwards request:
The proxy consults its connection table and finds that dev42 is accessible through HTTP connection 37. The proxy forwards
the browser request through HTTP connection 37.
5. Mobile node's HTTP server response:
The web server application on the mobile node retrieves the requested resource 'res' and sends the response back to the
proxy.
6. Proxy forwards response:
The proxy forwards the response back to the browser.
© Peter R. Egli 2015
18/18
Rev. 2.90
Comet – HTML5 – WebSockets indigoo.com
5. HTML5
HTML5 ~= HTML + CSS + Javascript
New features in HTML5 (incomplete list):
Check your browser‘s HTML5 support:
 http://modernizr.github.io/Modernizr/test/index.html
New feature Description
Microdata
Annotate HTML pages with semantic information ( semantic web).
Example microdata standards: schema.org
Web storage Key value pair storage to store arbitrary data (no more size restrictions as with cookies).
Web SQL database
Javascript API to access a browser-integrated SQL database.
This specification is not maintained anymore (see http://dev.w3.org/html5/webdatabase/).
Web workers
Background tasks that execute Javascript code. Allows to better separate the GUI from
application code processing (no more lengthy processing required in GUI event handlers).
Semantic tags New tags with semantics such as <SECTION>, <ARTICLE>, <HEADER>.
Audio and video tags Direct support for audio and video in HTML, no more plugins required (Flash, Silverlight).
Canvas2D and Canvas3D Canvas object for drawing shapes.
SVG support SVG (Scalable Vector Graphics) is now part of the HTML standard.
New CSS selectors nth-children(even/odd), first-child etc.
Web fonts Support for font standards like OTF (Open Type Font).

More Related Content

More from Peter R. Egli

Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)Peter R. Egli
 
Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)Peter R. Egli
 
Microsoft .NET Platform
Microsoft .NET PlatformMicrosoft .NET Platform
Microsoft .NET PlatformPeter R. Egli
 
Overview of Cloud Computing
Overview of Cloud ComputingOverview of Cloud Computing
Overview of Cloud ComputingPeter R. Egli
 
MQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingMQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingPeter R. Egli
 
Enterprise Application Integration Technologies
Enterprise Application Integration TechnologiesEnterprise Application Integration Technologies
Enterprise Application Integration TechnologiesPeter R. Egli
 
Overview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyOverview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyPeter R. Egli
 
Android Native Development Kit
Android Native Development KitAndroid Native Development Kit
Android Native Development KitPeter R. Egli
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Peter R. Egli
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Peter R. Egli
 
Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)Peter R. Egli
 
MSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingMSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingPeter R. Egli
 
Common Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBACommon Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBAPeter R. Egli
 
Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)Peter R. Egli
 
JMS - Java Messaging Service
JMS - Java Messaging ServiceJMS - Java Messaging Service
JMS - Java Messaging ServicePeter R. Egli
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Peter R. Egli
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State TransferPeter R. Egli
 
MOM - Message Oriented Middleware
MOM - Message Oriented MiddlewareMOM - Message Oriented Middleware
MOM - Message Oriented MiddlewarePeter R. Egli
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Peter R. Egli
 

More from Peter R. Egli (20)

Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)
 
Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)
 
Microsoft .NET Platform
Microsoft .NET PlatformMicrosoft .NET Platform
Microsoft .NET Platform
 
Overview of Cloud Computing
Overview of Cloud ComputingOverview of Cloud Computing
Overview of Cloud Computing
 
MQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingMQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message Queueing
 
Enterprise Application Integration Technologies
Enterprise Application Integration TechnologiesEnterprise Application Integration Technologies
Enterprise Application Integration Technologies
 
Overview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyOverview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technology
 
Android Native Development Kit
Android Native Development KitAndroid Native Development Kit
Android Native Development Kit
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)
 
Web services
Web servicesWeb services
Web services
 
Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)
 
MSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingMSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message Queueing
 
Common Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBACommon Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBA
 
Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)
 
JMS - Java Messaging Service
JMS - Java Messaging ServiceJMS - Java Messaging Service
JMS - Java Messaging Service
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
 
MOM - Message Oriented Middleware
MOM - Message Oriented MiddlewareMOM - Message Oriented Middleware
MOM - Message Oriented Middleware
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 

Recently uploaded

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Recently uploaded (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Comet, WebSockets, HTML5, SSE

  • 1. © Peter R. Egli 2015 1/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com Peter R. Egli INDIGOO.COM OVERVIEW OF WEB BASED SERVER PUSH TECHNOLOGIES COMET, HTML5 WEBSOCKETS
  • 2. © Peter R. Egli 2015 2/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com Contents 1. Server push technologies 2. HTML5 server events 3. WebSockets 4. Reverse HTTP 5. HTML5 overview
  • 3. © Peter R. Egli 2015 3/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com 1. Server push technologies (1/7) Problem: HTTP does not provide full bidirectional connections between client and server. HTTP is a request-response protocol. Asynchronous messages from the HTTP server to the client (server push) are not directly possible. HTTP was intentionally designed as a simple request-response protocol. This request-response scheme makes the server implementation simple, i.e. the server is stateless and thus does not have to maintain session state for each client. Over time different work-around techniques /solutions emerged to overcome this 'limitation' of HTTP. HTTP GET / POST HTTP Response HTTP message Every message from the server to the client requires a request beforehand. The HTTP protocol does not allow sending unsolicited messages from the server to the client. HTTP client HTTP server HTTP client HTTP server
  • 4. © Peter R. Egli 2015 4/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com 1. Server push technologies (2/7) Overview of solutions for server-push (1/3): Server push solutions A. Multiple HTTP connections B. Comet programming (umbrella term) C. Solutions with HTML5 B.1.1 Streaming + hidden iframe B.1.2 Streaming with XHR B.1 Streaming B.2 Long polling B.2.1 XHR long polling B.2.2 Script tag long polling C.1 HTML5 server sent events (SSE) C.2 WebSockets The client opens an HTTP connection to the server, the server opens a connection to the client. Example: XMPP BOSH protocol. Only for server client events (is not bidirectional). Full bidirectional connection between client and server. Browser dependent behavior. Browser dependent behavior. No X-site scripting (not possible to access another server). Complicated implementation. Complicates server impl.
  • 5. © Peter R. Egli 2015 5/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com Web server 1. Server push technologies (3/7) B.1.1 Streaming with hidden iframe (aka «forever frame») The HTML page contains a hidden IFRAME element. This IFRAME element is filled with a chunked HTML page (the page is thus indefinitely long, the server can asynchronously send updates to the client). The server updates contain HTML script tags with Javascript code that are asynchronously executed on the client. HTML page <IFRAME style= "display:none;"> <script> … </script> Web server Browser / web client <script> … </script> <script> … </script> Javascript engine
  • 6. © Peter R. Egli 2015 6/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com 1. Server push technologies (4/7) B.1.2 Streaming with XHR The XMLHttpRequest object in Javascript provides access to the HTTP connection in the client. When a message arrives, the Javascript engine calls the onreadystatechange function. Web server HTML page data (e.g. XML) Web server Browser / web client data (e.g. XML) data (e.g. XML) Javascript engine <script> xxx </script> <script language="Javascript"> function update() { self.xmlHttpRequest.onreadystatechange = function() { //to XML data processing here //access to XML: self.xmlHttpReq.responseXML } } </script>
  • 7. © Peter R. Egli 2015 7/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com 1. Server push technologies (5/7) B.2.1 XMLHttpRequest with long polling The client sends requests through the XMLHttpRequest Javascript object. After each response, the client "rearms" the polling by sending a new request. B.2.2 Script tag long polling: Same techniques as above, but the script code is embedded in <script> tags that can be filled with code from another second level domain. Possible across different second level domains (X-site scripting), but poses a security problem. HTTP request (XMLHttpRequest) HTTP Response An event on the server (data changed) requires the server to send an asynchronous update to the client. T HTTP request (XMLHttpRequest)Client (script) immediately "rearms" the polling by sending a new request. T HTTP Response HTTP request (XMLHttpRequest) Another server-side event HTTP client HTTP server
  • 8. © Peter R. Egli 2015 8/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com 1. Server push technologies (6/7) C.1 HTML5 server sent events (SSE): HTML5 server sent events (SSE) are similar to web sockets. SSE allow the server to asynchronously send data to the client. SSE differ from web sockets in that they only allow serverclient communication. Web server HTML page event data (e.g. JSON) Web server Browser / web client event data (e.g. JSON) event data (e.g. JSON) Javascript engine <script> xxx </script> <script language="Javascript"> var source = new EventSource('/serverevents/talk'); source.onmessage = function() { document.getElementById('content').innerHTML += e.data + '<br/>'; } } </script>
  • 9. © Peter R. Egli 2015 9/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com 1. Server push technologies (7/7) Higher layer protocols: Higher layer protocols define commands and responses that can be used in a client-server application. Examples: 1. Bayeux protocol (by Dojo foundation):  Protocol on top of a comet-mechanism supporting streaming & long-polling.  Defines frames, commands and fields etc. 2. JSON-RPC:  Protocol with 3 different message types that are mapped to HTTP: request, response, notification.  Peer-to-peer protocol, both client and server can send asynchronous notifications.  Different scenarios are possible: Comet HTTP Bayeux Comet HTTP Bayeux Bayeux protocol HTTP protocol HTTP JSON-RPC HTTP JSON-RPC Comet HTTP JSON-RPC Comet HTTP JSON-RPC Comet HTTP Bayeux Comet HTTP Bayeux JSON-RPC JSON-RPC JSON-RPC directly on top of HTTP. Fully bidirectional message communication of JSON-RPC is not possible. Comet provides bidirectional communication for JSON-RPC. JSON-RPC messages are mapped to Bayeux messaging protocol.
  • 10. © Peter R. Egli 2015 10/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com 3. WebSockets (1/3) History of HTML and WebSockets standards: W3C WWW Council; official standards body for WWW standards. WHATWG Web Hypertext Application Technology Working Group. Community of people (not vendors) interested in evolving HTML. Founded because the W3C XHTML WG was slow in making progress. IETF Hybi IETF Hypertext Bidirectional WG. Responsible for WebSocket IETF draft / RFC. 1999 XHTML WG WHATWG HyBi Published W3C standards 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2014 HTML 4.0 XHTML 1.0 XHTML 1.1 HTML5 Draft HTML5 Final Web Appl. 1.0 XHTML2 WG RIP W3C HTML WG WHATWG draft adopted as starting point RFC6455 WebSocket standard moved to HyBi W3C HTML5 Recommendation Oct. 28 2014 2011
  • 11. © Peter R. Egli 2015 11/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com 3. WebSockets (2/3): The WebSocket protocol defines the procedures to upgrade a plain-vanilla HTTP-connection to a fully bidirectional WebSocket transport connection. The WebSocket Javascript API defines the functions that give access to the WebSocket layer. • W3C is responsible for the WebSocket Javascript API standard. • IETF is responsible for the WebSocket protocol standard. • The WebSocket protocol standard is published as IETF RFC6455. See also http://www.websocket.org/. WebSocket protocol WebSocket API http://dev.w3.org/html5/websockets/ http://tools.ietf.org/html/rfc6455 Javascript script WebSocket protocol WebSocket API Service process
  • 12. © Peter R. Egli 2015 12/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com Server acknowledges to upgrade to WebSocket. The server confirms acceptance for upgrading with the Sec-WebSocket-Accept field. Application protocol (WebSocket subprotocol) that the server selects. 3. WebSockets (3/3): WebSocket handshake procedure for upgrading an HTTP connection: The client sends a normal HTTP GET request, but requests to upgrade to a WebSocket connection. Afterwards the connection remains active until it is closed and the client and server can exchange messages based on an application protocol. Client  server request (example from http://tools.ietf.org/html/rfc6455): GET /chat HTTP/1.1 Host: server.example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ== Origin: http://example.com Sec-WebSocket-Protocol: chat, superchat Sec-WebSocket-Version: 13 ServerClient response: HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: s3pPLMBiTxa…GzbK+xOo= Sec-WebSocket-Protocol: chat Upgrade to a WebSocket connection. Security fields to protect the handshake against man-in-the-middle attacks. Application protocols that the client supports. Standard HTTP method and Host field lines. Field for protocol version checks.
  • 13. © Peter R. Egli 2015 13/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com 4. Reverse HTTP (1/5): Problem: In many cases (embedded) clients are not accessible (visible) from the Internet because they are in a private network or behind a firewall with NAT (Network Address Translation). Thus it is impossible to connect to the embedded web server of such a device with a web browser from outside the private network. N.B.: The mobile or embedded devices are able to connect to the Internet (outgoing connections are possible if permitted by the firewall). Network with private IP addresses (RFC1918) such as a mobile provider network or a LAN. Web browser for accessing embedded or mobile device. Public Internet FW with NAT Mobile and embedded devices with private IP addresses 192.168.10.2 192.168.10.3 192.168.10.4 Public IP address (visible to web browser) Private network 20.20.30.1 MN MN: Mobile Node NAT: Network Address Translation LAN: Local Area Network FW: Firewall
  • 14. © Peter R. Egli 2015 14/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com 4. Reverse HTTP (2/5): Solution 1: VPN Through VPNs both the devices and the web browser are hooked into the same (private) network (172.16.1.0/24 in the example below). Provides security if combined with authentication and encryption. More complex installation. Requires a VPN client on the devices. Increased performance requirements on clients and servers (encryption, VPN protocol). Solution 2: Port Forwarding NAT firewall forwards port 80 to 192.168.10.2. No additional gear required. NAT firewall must be under control for adding the port forwarding rule. Security concerns (open port). LAN 172.16.1.0/24 Internet Private network 172.16.1.2 20.30.40.50 VPN server with public IP address 30.20.30.1 192.168.10.2 172.16.1.3 LAN 172.16.1.0/24 Internet Private network 172.16.1.2 30.20.30.1 192.168.10.2 80 Device 'dials' into VPN. The Firewall forwards requests to port 80 on the device. MN MN FW with NAT FW with NAT
  • 15. © Peter R. Egli 2015 15/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com 4. Reverse HTTP (3/5): Solution 3: Reverse HTTP (1/3) Reverse HTTP is an experimental protocol (see IETF draft http://tools.ietf.org/html/draft- lentczner-rhttp-00) that allows HTTP client and server to switch roles (client becomes server and vice versa). The firewall lets the packets pass since the mobile node opens the connection. During connection setup, HTTP client and server switch roles (client becomes server and vice versa). No VPN required (security could be satisfied with HTTPs). Can be combined with WebSockets or COMET protocols (see above) for server push. Reverse HTTP proxy required (there are open source solutions such as yaler.org). LAN 172.16.1.0/24 Internet Private network 172.16.1.2 Reverse HTTP proxy somewhere in the Internet 30.20.30.1 192.168.10.2 20.30.40.50 MN FW with NAT
  • 16. © Peter R. Egli 2015 16/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com 4. Reverse HTTP (4/5): Solution 3: Reverse HTTP (2/3) Message flow: Browser Proxy MNFirewall Register address: POST /dev42 HTTP/1.1 Upgrade: PTTH/1.0 Connection: Upgrade Host: devices.net 1 Proxy response: HTTP/1.1 Switching Protocols Upgrade: PTTH/1.0 Date: Sat, 10 Sept. 2011 Content-Length: 0 2 Proxy forwards request: GET /dev42/res HTTP/1.1 Host: devices.net 4 Server response: HTTP/1.1 OK Data (XML, JSON) 5 Browser (client) request: GET /dev42/res HTTP/1.1 Host: devices.net 3 Proxy forwards server response: HTTP/1.1 OK Data (XML, JSON) 6 ID Srv. Conn. … … dev42 37 … …
  • 17. © Peter R. Egli 2015 17/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com 4. Reverse HTTP (5/5) Solution 3: Reverse HTTP (3/3) 1. The mobile node registers with the proxy: The mobile node opens an outgoing HTTP connection to the proxy (the proxy must be accessible both by the mobile node and the web browser, so usually the proxy is somewhere in the Internet). The URL in the POST request contains an ID of the client (dev42 in the example). The mobile node requests to upgrade the connection to reverse HTTP with the HTTP header fields Upgrade: PTTH/1.0 and Connection: Upgrade. 2. Proxy accepts the connection switch: The proxy accepts the connection upgrade by responding with HTTP/1.1 Switching Protocols, Upgrade: PTTH/1.0. The proxy adds the mobile client's ID (dev42) to its connection table (dev42 is accessible through HTTP connection 37). From now on the proxy acts like an HTTP client while the mobile node is an HTTP server. 3. Browser request: The user enters the URL http://www.devices.net/dev42/res in the browser in order to access the resource 'res' on the mobile node. The host in the URL is the proxy's domain name address, so the browser sends the request to the proxy. 4. Proxy forwards request: The proxy consults its connection table and finds that dev42 is accessible through HTTP connection 37. The proxy forwards the browser request through HTTP connection 37. 5. Mobile node's HTTP server response: The web server application on the mobile node retrieves the requested resource 'res' and sends the response back to the proxy. 6. Proxy forwards response: The proxy forwards the response back to the browser.
  • 18. © Peter R. Egli 2015 18/18 Rev. 2.90 Comet – HTML5 – WebSockets indigoo.com 5. HTML5 HTML5 ~= HTML + CSS + Javascript New features in HTML5 (incomplete list): Check your browser‘s HTML5 support:  http://modernizr.github.io/Modernizr/test/index.html New feature Description Microdata Annotate HTML pages with semantic information ( semantic web). Example microdata standards: schema.org Web storage Key value pair storage to store arbitrary data (no more size restrictions as with cookies). Web SQL database Javascript API to access a browser-integrated SQL database. This specification is not maintained anymore (see http://dev.w3.org/html5/webdatabase/). Web workers Background tasks that execute Javascript code. Allows to better separate the GUI from application code processing (no more lengthy processing required in GUI event handlers). Semantic tags New tags with semantics such as <SECTION>, <ARTICLE>, <HEADER>. Audio and video tags Direct support for audio and video in HTML, no more plugins required (Flash, Silverlight). Canvas2D and Canvas3D Canvas object for drawing shapes. SVG support SVG (Scalable Vector Graphics) is now part of the HTML standard. New CSS selectors nth-children(even/odd), first-child etc. Web fonts Support for font standards like OTF (Open Type Font).