Jumping Bean Jumping Bean
Introduction to Web Sockets
Jumping Bean Jumping Bean
What are Web Sockets?
● Part of HTML5 set of standards,
● Allows server to push data to client,
...
Jumping Bean Jumping Bean
What are Web Sockets?
● Full duplex communication channel over a single tcp connection,
● Requir...
Jumping Bean Jumping Bean
Web Socket Protocol
Jumping Bean Jumping Bean
Browser Support
Jumping Bean Jumping Bean
Web Socket Applications
● Client side javascript
– Uses standard W3C based API
● Server Side
– P...
Jumping Bean Jumping Bean
Server Support
● Apache does not yet have support
– Many plugins/libraries/standalone servers fo...
Jumping Bean Jumping Bean
Client Web Socket API
ww.w3.org
Jumping Bean Jumping Bean
Events
● Message Event
– Data -
● String,
● Blob,
● ArrayBuffer
● Close Event
– code – unsigned ...
Jumping Bean Jumping Bean
Simple Demo
●Send message to server
●Illustrate the basic structure of client side
javascript
●U...
Jumping Bean Jumping Bean
Chat Demo
●Show interaction between two clients,
●Node.js on the server side.
Upcoming SlideShare
Loading in …5
×

Introduction to Web Sockets

1,447
-1

Published on

Slides from my presentation on web sockets at the HTML5 Developer Group Meetup on the 26th September 2013.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,447
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Introduction to Web Sockets

  1. 1. Jumping Bean Jumping Bean Introduction to Web Sockets
  2. 2. Jumping Bean Jumping Bean What are Web Sockets? ● Part of HTML5 set of standards, ● Allows server to push data to client, ● Allow client to send/request data from server ● Uses a persistent connection, ● Less overhead than HTTP, web sockets uses data or text frames as its protocol, ● Replaces solutions such as: – Comet, – Long polling – Short polling
  3. 3. Jumping Bean Jumping Bean What are Web Sockets? ● Full duplex communication channel over a single tcp connection, ● Requires web browsers and servers to support web sockets, ● Uses standard HTTP/HTTPS ports, ● Uses HTTP protocol to request an upgrade to the web socket protocol, ● No more cross domain issues, ● Ping/Pong frames for keep-alive, hearbeat, ● URI – – ws://html5.co.za/chat – Wss://html5.co.za/chat
  4. 4. Jumping Bean Jumping Bean Web Socket Protocol
  5. 5. Jumping Bean Jumping Bean Browser Support
  6. 6. Jumping Bean Jumping Bean Web Socket Applications ● Client side javascript – Uses standard W3C based API ● Server Side – Platform dependent ● Note: There are many non-standard compliant client and server libraries available to mimic web sockets. – Be aware that the server side implementation must support the client side protocol
  7. 7. Jumping Bean Jumping Bean Server Support ● Apache does not yet have support – Many plugins/libraries/standalone servers for different technologies, ● PHP – Ratcket ● Java – Glassfish/Tomcat – Support in Java EE 7 ● Javascript – Node.js - many libraries not all standard compliant and not all good.
  8. 8. Jumping Bean Jumping Bean Client Web Socket API ww.w3.org
  9. 9. Jumping Bean Jumping Bean Events ● Message Event – Data - ● String, ● Blob, ● ArrayBuffer ● Close Event – code – unsigned long – code provided by server – reason – string – reason for close – wasClean – boolean – was connection cleanly closed
  10. 10. Jumping Bean Jumping Bean Simple Demo ●Send message to server ●Illustrate the basic structure of client side javascript ●Use node.js on the server side
  11. 11. Jumping Bean Jumping Bean Chat Demo ●Show interaction between two clients, ●Node.js on the server side.
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×