• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Introduction to Web Sockets
 

Introduction to Web Sockets

on

  • 1,070 views

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

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

Statistics

Views

Total Views
1,070
Views on SlideShare
1,070
Embed Views
0

Actions

Likes
0
Downloads
7
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Introduction to Web Sockets Introduction to Web Sockets Presentation Transcript

    • 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, ● 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
    • 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
    • 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 – 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
    • 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.
    • 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 long – code provided by server – reason – string – reason for close – wasClean – boolean – was connection cleanly closed
    • 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
    • Jumping Bean Jumping Bean Chat Demo ●Show interaction between two clients, ●Node.js on the server side.