SockJS Intro

  • Upload
    ngoc-dao

  • View
    11.318

  • Download
    2

Embed Size (px)

Citation preview

  1. 1. SockJS Intro Ngoc Dao
  2. 2. Do you know WebSocket?
  3. 3. WebSocket
  4. 4. WebSocketNew browsers are required: Internet Explorer: 10 Firefox: 6 Chrome: 4 Safari: 5 Opera: 12.10
  5. 5. SockJS Provides WebSocket-like API Supports all browsers, e.g. IE 6 Transports: websocket xhr-streaming xdr-streaming iframe-eventsource iframe-htmlfilexhr-polling xdr-polling iframe-xhr-polling jsonp-polling Requires Client side: sockjs.js Server side: SockJS server side library
  6. 6. WebSocket vs SockJSWebSocketSockJS
  7. 7. Links Client side:https://github.com/sockjs/sockjs-client Server side:Node.js: https://github.com/sockjs/sockjs-nodeRuby: https://github.com/sockjs/sockjs-rubyPython: https://github.com/MrJoes/sockjs-tornadoJVM: https://github.com/vert-x/vert.x https://github.com/ngocdaothanh/xitrumetc.
  8. 8. Links Client side:https://github.com/sockjs/sockjs-client Server side:Node.js: https://github.com/sockjs/sockjs-nodeRuby: https://github.com/sockjs/sockjs-rubyPython: https://github.com/MrJoes/sockjs-tornadoJVM: https://github.com/vert-x/vert.x https://github.com/ngocdaothanh/xitrumetc.
  9. 9. Demohttps://github.com/sockjs/sockjs-node/tree/master/examples/echogit clone git://github.com/sockjs/sockjs-node.gitcd sockjs-node/examples/echonpm installnode server.js
  10. 10. SockJS protocolIf you want to implement a server side for SockJS,or just want to know how SockJS works:https://github.com/sockjs/sockjs-protocolhttp://sockjs.github.com/sockjs-protocol/sockjs-protocol-0.3.3.html
  11. 11. SockJS vs Socket.IO Socket.IO SockJS + SockJS is way simpler, closer to WebSocket=> SockJS has lots of server sideimplementations for many languages