{"action":"created","issue":{"url":"https://api.github.com/repos/balderdashy/sails/issues/945","labels_url":"https://api.github.com/repos/balderdashy/sails/issues/945/labels{/name}","comments_url":"https://api.github.com/repos/balderdashy/sails/issues/945/comments","events_url":"https://api.github.com/repos/balderdashy/sails/issues/945/events","html_url":"https://github.com/balderdashy/sails/issues/945","id":20496146,"number":945,"title":"Replace Socket.io with Primus","user":{"login":"alejandroiglesias","id":480640,"avatar_url":"https://avatars.githubusercontent.com/u/480640?v=3","gravatar_id":"","url":"https://api.github.com/users/alejandroiglesias","html_url":"https://github.com/alejandroiglesias","followers_url":"https://api.github.com/users/alejandroiglesias/followers","following_url":"https://api.github.com/users/alejandroiglesias/following{/other_user}","gists_url":"https://api.github.com/users/alejandroiglesias/gists{/gist_id}","starred_url":"https://api.github.com/users/alejandroiglesias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alejandroiglesias/subscriptions","organizations_url":"https://api.github.com/users/alejandroiglesias/orgs","repos_url":"https://api.github.com/users/alejandroiglesias/repos","events_url":"https://api.github.com/users/alejandroiglesias/events{/privacy}","received_events_url":"https://api.github.com/users/alejandroiglesias/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/balderdashy/sails/milestones/2","labels_url":"https://api.github.com/repos/balderdashy/sails/milestones/2/labels","id":345428,"number":2,"title":"Feature Requests / Ideas","description":"Ideas for features / improvements","creator":{"login":"mikermcneil","id":618009,"avatar_url":"https://avatars.githubusercontent.com/u/618009?v=3","gravatar_id":"","url":"https://api.github.com/users/mikermcneil","html_url":"https://github.com/mikermcneil","followers_url":"https://api.github.com/users/mikermcneil/followers","following_url":"https://api.github.com/users/mikermcneil/following{/other_user}","gists_url":"https://api.github.com/users/mikermcneil/gists{/gist_id}","starred_url":"https://api.github.com/users/mikermcneil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikermcneil/subscriptions","organizations_url":"https://api.github.com/users/mikermcneil/orgs","repos_url":"https://api.github.com/users/mikermcneil/repos","events_url":"https://api.github.com/users/mikermcneil/events{/privacy}","received_events_url":"https://api.github.com/users/mikermcneil/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":188,"state":"open","created_at":"2013-05-31T07:24:00Z","updated_at":"2014-09-23T15:45:45Z","due_on":null,"closed_at":null},"comments":22,"created_at":"2013-10-04T03:44:43Z","updated_at":"2015-01-28T15:52:09Z","closed_at":"2014-05-20T02:04:45Z","body":"Hi, i would like to suggest replacing Socket.io with [Primus](https://github.com/primus/primus), which is \"a simple abstraction around real-time frameworks\" and \"allows you to easily switch between different frameworks without any code changes\". It supports Engine.IO, WebSockets, BrowserChannel, SockJS and Socket.IO as transports or \"transformers\" as they call them.\r\n\r\n### Advantages\r\n\r\n1. Effortless switching between real-time frameworks by changing one single line of code. No more API rewrites needed when your project requirements change, the framework get abandoned or simply breaks down.\r\n2. Build-in reconnect, it just works. The reconnect is controlled by an randomized exponential backoff algorithm to reduce server stress.\r\n3. Offline detection, Primus is smart enough to detect when a users drop their internet connection (switching WIFI points/cell towers for example) and reconnects when they are back online.\r\n4. Automatically encodes and decodes messages using custom parsers. Can be easily switched for binary encoding for example.\r\n5. A clean and stream compatible interface for the client and server. You can just stream#pipe data around. In addition to that, the client works on Node.js as well, write once, run it everywhere.\r\n6. Fixes various of bugs in the supported frameworks and additions stability patches to improve real-time communication.\r\n7. Comes with an amazing plugin interface to keep the core library as fast and lean as possible while still allowing the server and the client to be extended.\r\n8. Last but not least, Primus is build with love, passion and dedication to the real-time web.\r\n\r\n### Main motivation\r\n\r\nThe main motivation to ask you to switch to Primus is that i want to use SockJS instead of Socket.io as i don't trust too much on the latter.\r\n\r\n[There are very solid arguments](http://xsnippet.org/359042/) from [sockjs-tornado](https://github.com/mrjoes/sockjs-tornado) developer.\r\nAnd from Primus developer:\r\n>There are small bugs in Engine.IO that are causing our tests to fail. I've submitted patches for these bugs, but they have been reject for silly reasons. The bug causes closed connections to say open. If you're experiencing this you can apply this patch.\r\n\r\n(Engine.IO and Socket.IO are developed by the same guy and seems that Socket.IO will use Engine.IO internally in the coming versions.)\r\n\r\nSo based on all those arguments i think that Sails will benefit too from having a more solid transport and it would be great to use Primus to be able to select your preferred transport and/or take advantage of their optimizations.\r\n\r\n**Yes, i'm willing to help, but can't be done on my own as i don't know lots of things regarding the internals of Sails.**\r\n\r\nCheers.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/balderdashy/sails/issues/comments/71857768","html_url":"https://github.com/balderdashy/sails/issues/945#issuecomment-71857768","issue_url":"https://api.github.com/repos/balderdashy/sails/issues/945","id":71857768,"user":{"login":"mikermcneil","id":618009,"avatar_url":"https://avatars.githubusercontent.com/u/618009?v=3","gravatar_id":"","url":"https://api.github.com/users/mikermcneil","html_url":"https://github.com/mikermcneil","followers_url":"https://api.github.com/users/mikermcneil/followers","following_url":"https://api.github.com/users/mikermcneil/following{/other_user}","gists_url":"https://api.github.com/users/mikermcneil/gists{/gist_id}","starred_url":"https://api.github.com/users/mikermcneil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikermcneil/subscriptions","organizations_url":"https://api.github.com/users/mikermcneil/orgs","repos_url":"https://api.github.com/users/mikermcneil/repos","events_url":"https://api.github.com/users/mikermcneil/events{/privacy}","received_events_url":"https://api.github.com/users/mikermcneil/received_events","type":"User","site_admin":false},"created_at":"2015-01-28T15:52:09Z","updated_at":"2015-01-28T15:52:09Z","body":"updated roadmap: https://github.com/balderdashy/sails/commit/9ee19516e54fdf330c760cce1e0aa1d998be234a"}}