Introduction to WebSockets
A Workshop
Agenda
- Short presentation: intro to Websockets
- Overview of demo code
- Q&A, and maybe some livecoding
Jack Lawson
Engineer at Airbnb ps: we're hiring
Web Game Hobbyist
Gaming?
Good time for gaming in the browser
- Audio API
- WebGL, Canvas
- Pointer lock
- Good browsers to implement it all
- (WebSockets)
But Also, Other Uses
- Airbnb - Internal Tools
- CMS - collaborative editing
- Support chats
- Live Analytics
But, These Things Existed Before WebSockets
- Oracleâ„¢ Java® Applets
- Flash and Silverlight applications
- Comet connections
- Ajax polling (my personal favorite)
- <meta http-equiv="refresh" content="5">
WebSockets Are Bidirectional & Full Duplex
The client is connected to the server, and the server is connected to the client, and can
send data at the same time over TCP.
WebSockets Are Secure
WebSocket connections are secured with a handshake and masking, and also support SSL.
WebSockets Are Simple
socket = new WebSocket("ws://echo.websocket.org/");