Marek pubsubhuddle realtime_web

522
-1

Published on

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
522
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Marek pubsubhuddle realtime_web

  1. 1. Realtime web:Not there yet! Marek Majkowski marek@rabbitmq.com 1
  2. 2. Nogi 2
  3. 3. 3
  4. 4. 4
  5. 5. 5
  6. 6. 6
  7. 7. 7
  8. 8. WebSocketshixie-75 4 5.0.0 4 11hixie-76 6 5.0.1 (disabled) (disabled)hybi-07 6hybi-10 7 14 10-dev 8
  9. 9. Spot the difference!$ nc localhost 8080 $ nc localhost 12345GET /broadcast/765/321/websocket HTTP/1.1 GET /echo HTTP/1.1Origin: http://172.16.173.128:8080 Origin: http://172.16.173.128:12345Host: 172.16.173.128:8080 Host: 172.16.173.128:12345Connection: Upgrade Connection: UpgradeUpgrade: WebSocket Upgrade: WebSocketSec-WebSocket-Key2: `1]2037 7 GX f<Vb1*5$64 Sec-WebSocket-Key2: `1]2037 7 GX f<Vb1*5$64Sec-WebSocket-Key1: 2Uf ?<,4C28E1K7J4+208 Sec-WebSocket-Key1: 2Uf ?<,4C28E1K7J4+208Cookie2: $Version=1 Cookie2: $Version=1Cookie: JSESSIONID=a Cookie: JSESSIONID=aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaHTTP/1.1 101 WebSocket Protocol Handshake HTTP/1.1 101 WebSocket Protocol HandshakeUpgrade: websocket Upgrade: WebSocketConnection: Upgrade Connection: UpgradeSec-WebSocket-Location: ws://[...] Sec-WebSocket-Location: ws://[...]Sec-WebSocket-Origin: http://[...] Sec-WebSocket-Origin: http://[...]m"7]SDgo0 m"7]SDgo0^C ^C 9
  10. 10. The RFC says-> If the entrys name is "upgrade" If the value is not exactly equal to the string "WebSocket", then fail the WebSocket connection and abort these steps.[...]|Upgrade| The value must be the string "WebSocket".[...]|Upgrade| Invariant part of the handshake. Will always have a value that is an ASCII case-insensitive match for the string "WebSocket". 10
  11. 11. ProxiesGET /echo/070/lm6wwjpr/websocket HTTP/1.1 CONNECT sockjs1.popcnt.org:80 HTTP/1.1Host: sockjs1.popcnt.org Host: sockjs1.popcnt.orgUser-Agent: [...] Gecko/20100101 Firefox/6.0.2 Proxy-Connection: keep-aliveAccept: text/html,application/xhtml [...]Accept-Language: en-us,en;q=0.5 GET /echo/855/duzzy2p1/websocket HTTP/1.1Accept-Encoding: gzip, deflate Upgrade: WebSocketAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Connection: UpgradeSec-WebSocket-Version: 7 Host: sockjs1.popcnt.orgSec-WebSocket-Origin: http://sockjs.popcnt.org Origin: http://sockjs.popcnt.orgSec-WebSocket-Key: bzG4fOYXabSiy42uFj6vjA== Sec-WebSocket-Key1: 22p/ D"47900%n7 r90.Pragma: no-cache Sec-WebSocket-Key2: m49" 5 f 24772 RaCache-Control: no-cacheUpgrade: websocketConnection: UpgradeHTTP/1.0 400 Bad RequestServer: squid/2.7.STABLE9Date: Wed, 21 Sep 2011 06:16:10 GMTContent-Type: text/htmlContent-Length: 1943X-Squid-Error: ERR_INVALID_REQ 0X-Cache: MISS from mrstuX-Cache-Lookup: NONE from mrstu:3128Via: 1.0 mrstu:3128 (squid/2.7.STABLE9)Connection: close 11
  12. 12. • #1 Realtime web: Not there yet! 12
  13. 13. Shared nothing + database 13
  14. 14. Shared nothing + message bus 14
  15. 15. Node.js + Socket.io 15
  16. 16. Sync + Async 16
  17. 17. Sync + Service 17
  18. 18. 18
  19. 19. Google App Engine 19
  20. 20. Google App Engine• Simplex 19
  21. 21. Google App Engine• Simplex• No broadcast 19
  22. 22. Google App Engine• Simplex• No broadcast• No presence 19
  23. 23. PubNub 20
  24. 24. PubNub• Duplex 20
  25. 25. PubNub• Duplex• Broadcast 20
  26. 26. PubNub• Duplex• Broadcast• No access rights 20
  27. 27. PubNub• Duplex• Broadcast• No access rights• No identity 20
  28. 28. Pusher 21
  29. 29. Pusher• Simplex 21
  30. 30. Pusher• Simplex• Broadcast 21
  31. 31. Pusher• Simplex• Broadcast• Access rights * 21
  32. 32. Pusher• Simplex• Broadcast• Access rights *• Identity * 21
  33. 33. Pusher• Simplex• Broadcast• Access rights *• Identity *• Presence * 21
  34. 34. We can do better 22
  35. 35. We can do better• Duplex 22
  36. 36. We can do better• Duplex• Broadcast 22
  37. 37. We can do better• Duplex• Broadcast• Access rights 22
  38. 38. We can do better• Duplex• Broadcast• Access rights• Identity 22
  39. 39. We can do better• Duplex• Broadcast• Access rights• Identity• Presence 22
  40. 40. 23
  41. 41. • Authorisation 23
  42. 42. • Authorisation • Identity 23
  43. 43. • Authorisation • Identity • Permissions 23
  44. 44. • Authorisation • Identity • Permissions• Resource definitions + semantics 23
  45. 45. • Authorisation • Identity • Permissions• Resource definitions + semantics• Value + updates? 23
  46. 46. • Authorisation • Identity • Permissions• Resource definitions + semantics• Value + updates?• Messages back to App (WebHooks) 23
  47. 47. • Authorisation • Identity • Permissions• Resource definitions + semantics• Value + updates?• Messages back to App (WebHooks)• Presence 23
  48. 48. • Authorisation • Identity • Permissions• Resource definitions + semantics• Value + updates?• Messages back to App (WebHooks)• Presence• Good luck writing documentation! 23
  49. 49. Service? 24
  50. 50. Sync + Async 25
  51. 51. Fully async 26
  52. 52. SockJS 27
  53. 53. • #3 Realtime web: Not there yet! 28
  54. 54. 29
  55. 55. 30
  56. 56. #sockjsgithub.com/sockjs 31
  57. 57. 1. token 32
  58. 58. 2. token 33
  59. 59. 3. token 34
  60. 60. So? 35
  61. 61. 36

×