introduction of websockets
DESCRIPTION
Introduction of WebSockets, how it works, compression with AJAX, WebSockets represent a long awaited evolution in client/server web technology.TRANSCRIPT
![Page 1: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/1.jpg)
WebSockets?What are
![Page 2: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/2.jpg)
WebShocketsWebSockets represent a long awaited evolution in client/server web technology.
They allow a long-held single TCP socket connection to be established between the client and server which allows for bi-directional, full duplex, messages to be instantly distributed with little overhead resulting in a very low latency connection.
![Page 3: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/3.jpg)
Both the WebSocket API and the WebSocket protocol are
standardised which means the web now has an agreed standard
for realtime communication between Internet clients and
servers.
![Page 4: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/4.jpg)
Originally considered a browser technology, WebSockets are reaching far beyond just web browsers and are becoming a cross platform standard for realtime communication between client and server
![Page 5: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/5.jpg)
As well as native WebSocket support in browsers such as Google Chrome,
Firefox, Opera and a prototype Silverlight to JavaScript bridge
implementation for Internet Explorer, there are now WebSocket library
implementations in Objective-C, .NET, Ruby, Java, node.js, ActionScript and
many other languages.
![Page 6: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/6.jpg)
A brief history of the web(from a developer’s perspective)
![Page 7: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/7.jpg)
The Internet wasn’t built to be all that dynamic. It was conceived to be a collection of HyperText Markup Language (HTML) pages linking to one another to form a conceptual web of information.
![Page 8: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/8.jpg)
Over time the static resources increased in number and richer items, such as images, began to be part of the web fabric.
Server technologies advanced allowing for dynamic server pages - pages whose content was generated based on a query.
![Page 9: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/9.jpg)
Soon the requirement to have more dynamic web pages lead to the availability of Dynamic HyperText Markup Language (DHTML) all thanks to JavaScript (let’s pretend VBScript never existed). Over the following years we saw cross frame communication in an attempt to avoid page reloads followed by HTTP Polling within frames.
![Page 10: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/10.jpg)
Things started to get interesting with the introduction of LiveConnect, then the forever frame technique, and finally, thanks to Microsoft, we ended up with the XMLHttpRequest object and therefore Asynchronous JavaScript and XML (AJAX).
In turn, AJAX madeXHR Long-Polling and XHR Streaming possible. But none of these solutions offered a truly standardised cross browser solution to realtime bi-directional communication between a server and a client.
![Page 11: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/11.jpg)
Then along came
WebSockets
![Page 12: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/12.jpg)
Why WebSockets are a game-changer?
Finally,WebSockets represent a standard for bi-directional realtime communication between servers and clients.
Firstly in web browsers, but ultimately between any server and any client.
![Page 13: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/13.jpg)
Why WebSockets are a game-changer?
The standards first approach means that as developers we can finally create functionality that works consistently across multiple platforms.
Connection limitations are no longer a problem since WebSockets represent a single TCP socket connection.
![Page 14: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/14.jpg)
Why WebSockets are a game-changer?
Cross domain communication has been considered from day one and is dealt with within the connection handshake.
This means that services such as Pusher can easily use them when offering a massively scalable realtime platform that can be used by any website, web, desktop or mobile application.
![Page 15: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/15.jpg)
WebSocketsvs
AJAX
![Page 16: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/16.jpg)
WebSockets vs AJAX
WebSockets don’t make AJAX obsolete but they do supersede Comet (HTTP Long-polling/HTTP Streaming) as the solution of choice for true realtime
functionality.
![Page 17: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/17.jpg)
AJAX should still be used for making short-lived web service calls, and if we eventually see a good uptake in CORS supporting
web services, it will get even more useful.
WebSockets vs AJAX
![Page 18: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/18.jpg)
WebSockets should now be the go to standard for realtime
functionality since they offer low latency bi-directional
communication over a single connection.
WebSockets vs AJAX
![Page 19: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/19.jpg)
Even if a web browser doesn’t natively support the WebSocket object there are polyfill fallback options which all but guarantee any web browser can
actually establish a WebSocket connection.
WebSockets vs AJAX
![Page 20: Introduction of WebSockets](https://reader035.vdocuments.site/reader035/viewer/2022062220/5562066bd8b42ae04e8b5b40/html5/thumbnails/20.jpg)
Thanks…
Created By: Ashish KumarSource: http://pusher.com/websockets