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