Web Communication    adrian.olaru@1and1.ro
Connectivity
Web Messaging  Web WorkersServer Sent Events  Web Sockets
The way of the force
Sending complex data
Don’t trust client e.dataAlways check e.origin
Web Messaging allows documents from different domains tocommunicate with each other in a secure way
Browser Support* * source: http://caniuse.com              5.0+              3.0+              8.0              4.0+      ...
Use Casesportalswidgetsadstraffic counters
Web Workersrun JavaScript in parallel on a web page, without           blocking the user interface
Browser Support* * source: http://caniuse.com              5.0+              3.5+              4.0+              10.6+
Notescan’t access parent & it’s DOM‘this’ == current workercan use XHR, SSE or WebSocketcan importScripts(‘script.js’)can ...
Server Sent Eventspush data from the server to the client over HTTP
Browser Support* * source: http://caniuse.com              6.0+              4.0              5.0              11
Use Casessubscribe to live scorereal time pollsbidding updates for actionsstock quoteslive news
Web Socketsa bi-directional connection between the server and the                          client
Browser Support* * source: http://caniuse.com                 5.0+                 4.0                        *           ...
Notesfull duplex communicationremoves the overhead (only 2 bytes)dramatically reduces complexity
Use Casesonline chatonline gamesrealtime geolocationpackage tracking
Demoshttp://github.com/adrianolaru/webcom
Danke
Web Communication
Web Communication
Web Communication
Web Communication
Web Communication
Web Communication
Web Communication
Web Communication
Web Communication
Web Communication
Web Communication
Web Communication
Web Communication
Web Communication
Upcoming SlideShare
Loading in …5
×

Web Communication

812 views

Published on

Web Messaging, Web Workers, Server Sent Events, Web Sockets

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

  • Be the first to like this

No Downloads
Views
Total views
812
On SlideShare
0
From Embeds
0
Number of Embeds
20
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Web Communication

  1. 1. Web Communication adrian.olaru@1and1.ro
  2. 2. Connectivity
  3. 3. Web Messaging Web WorkersServer Sent Events Web Sockets
  4. 4. The way of the force
  5. 5. Sending complex data
  6. 6. Don’t trust client e.dataAlways check e.origin
  7. 7. Web Messaging allows documents from different domains tocommunicate with each other in a secure way
  8. 8. Browser Support* * source: http://caniuse.com 5.0+ 3.0+ 8.0 4.0+ 10.1+
  9. 9. Use Casesportalswidgetsadstraffic counters
  10. 10. Web Workersrun JavaScript in parallel on a web page, without blocking the user interface
  11. 11. Browser Support* * source: http://caniuse.com 5.0+ 3.5+ 4.0+ 10.6+
  12. 12. Notescan’t access parent & it’s DOM‘this’ == current workercan use XHR, SSE or WebSocketcan importScripts(‘script.js’)can use other workerscan use timers (setTimeout, setInterval)
  13. 13. Server Sent Eventspush data from the server to the client over HTTP
  14. 14. Browser Support* * source: http://caniuse.com 6.0+ 4.0 5.0 11
  15. 15. Use Casessubscribe to live scorereal time pollsbidding updates for actionsstock quoteslive news
  16. 16. Web Socketsa bi-directional connection between the server and the client
  17. 17. Browser Support* * source: http://caniuse.com 5.0+ 4.0 * 5.0 11 * * deactivated by default
  18. 18. Notesfull duplex communicationremoves the overhead (only 2 bytes)dramatically reduces complexity
  19. 19. Use Casesonline chatonline gamesrealtime geolocationpackage tracking
  20. 20. Demoshttp://github.com/adrianolaru/webcom
  21. 21. Danke

×