• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Websockets
 

Websockets

on

  • 322 views

Intro to WebSockets

Intro to WebSockets

Statistics

Views

Total Views
322
Views on SlideShare
303
Embed Views
19

Actions

Likes
0
Downloads
10
Comments
0

1 Embed 19

http://librosweb.es 19

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

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

    Websockets Websockets Presentation Transcript

    • WebSockets with Sheridan Roberts
    • ● I’m Sheridan! ● Self-taught geeky kid ● Started out in networking and infrastructure ● Worked in that for a while ● Quit ● Started doing development ● Now consulting ● I have no impressive credentials. Sorry. ● Also, I have not slept in ~30 hours by the time I’m speaking to you First, who is this guy talking to me?
    • What Is It? ● TCP Protocol ● HTTP Upgrade ● Bidirectional ● RFC 6455
    • WebSocket Frame 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-------+-+-------------+-------------------------------+ |F|R|R|R| opcode|M| Payload len | Extended payload length | |I|S|S|S| (4) |A| (7) | (16/64) | |N|V|V|V| |S| | (if payload len==126/127) | | |1|2|3| |K| | | +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - + | Extended payload length continued, if payload len == 127 | + - - - - - - - - - - - - - - - +-------------------------------+ | |Masking-key, if MASK set to 1 | +-------------------------------+-------------------------------+ | Masking-key (continued) | Payload Data | +-------------------------------- - - - - - - - - - - - - - - - + : Payload Data continued ... : + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + | Payload Data continued ... | +---------------------------------------------------------------+
    • When to use a WebSocket When you need bidirectional communication and one of the endpoints is a browser. ● Client/Server (AJAX) ● Gaming ● WebSocket Proxies for TCP services ● ...there are more applications
    • So...there have to be cons... ● It’s not an HTTP request like AJAX/Comet ○ Sheridan: Explain here how this would be done with WebSockets. ● Cross-browser development can be difficult (for now) ● XSS just got worse ● WebSockets were supposed to be simple; security has made them complex ○ More on this later
    • Demo Lets see WebSockets in action!
    • ● More decision-making to the server ● Origin header checking in wsHandler Handshake ● Would probably be in: ○ Firebase (cloud, database) ○ Autobahn (python) ○ Socket.IO (JavaScript, Flash fallback) ○ Pusher (cloud) ○ Websocket-Rails / Tubesock ○ ...another similar product (these things are taking off!) How would the demo REALLY look?
    • Practice Safe WebSocketing ● Security is presently “roll your own” ○ Origin header ○ Sessions ○ VALIDATE YOUR INFORMATION (Jordan Kasper shoutout)
    • P.S., I think CSS sprite animations with WebSocket backend might be a cool Hack-a-thon project, if someone wants to try it out. Making a simple little HTML5 game is not difficult and there are plenty of examples online.
    • Got Questions? I’ll try to answer them