This talk discusses how AJAX differs from WebSockets and how the technology can be used to implement rich real-time experiences. It also produces a live demo using EmberJS.
19. Ben LimmerGEMConf - 5/21/2016 ember.party
update?
nope.
(old way)
short polling
update?
nope.
data
update?
yep!
20. Ben LimmerGEMConf - 5/21/2016 ember.party
(old way)
long polling
request
Keep-Alive
timeout
request
Keep-Alive
data
response
request
Keep-Alive
21. Ben LimmerGEMConf - 5/21/2016 ember.party
WebSockets
handshake
connection opened
bi-directional
communication
22. Ben LimmerGEMConf - 5/21/2016 ember.party
WebSockets
no polling
full duplex over TCP
communication over
standard HTTP(S) ports
broadcast to all
connected clients
23. Ben LimmerGEMConf - 5/21/2016 ember.party
Talk Roadmap
⢠WebSockets vs. AJAX
⢠Fundamentals of WebSockets
⢠Code!
⢠Other Considerations
47. Ben LimmerGEMConf - 5/21/2016 ember.party
ember install ember-websockets
⢠integrates with the Ember runloop
⢠is an Ember.ObjectProxy
⢠abstracts away the WebSocket
83. Ben LimmerGEMConf - 5/21/2016 ember.party
Talk Roadmap
⢠AJAX vs. WebSockets
⢠Fundamentals of WebSockets
⢠Code!
⢠Other Considerations
84. Ben LimmerGEMConf - 5/21/2016 ember.party
other considerations
⢠security
⢠websocket support (libraries)
⢠learn from example
85. Ben LimmerGEMConf - 5/21/2016 ember.party
security
⢠Use TLS (wss:// vs. ws://)
⢠Verify the Origin header
⢠Verify the request by using a random token on
handshake
source: WebSocket (Andrew Lombardi) - OâReilly
86. Ben LimmerGEMConf - 5/21/2016 ember.party
other considerations
⢠security
⢠websocket support (libraries)
⢠learn from example