{"action":"closed","issue":{"url":"https://api.github.com/repos/feathersjs/feathers/issues/265","repository_url":"https://api.github.com/repos/feathersjs/feathers","labels_url":"https://api.github.com/repos/feathersjs/feathers/issues/265/labels{/name}","comments_url":"https://api.github.com/repos/feathersjs/feathers/issues/265/comments","events_url":"https://api.github.com/repos/feathersjs/feathers/issues/265/events","html_url":"https://github.com/feathersjs/feathers/issues/265","id":141215402,"number":265,"title":"SocketCluster support","user":{"login":"IngwiePhoenix","id":2893716,"avatar_url":"https://avatars.githubusercontent.com/u/2893716?v=3","gravatar_id":"","url":"https://api.github.com/users/IngwiePhoenix","html_url":"https://github.com/IngwiePhoenix","followers_url":"https://api.github.com/users/IngwiePhoenix/followers","following_url":"https://api.github.com/users/IngwiePhoenix/following{/other_user}","gists_url":"https://api.github.com/users/IngwiePhoenix/gists{/gist_id}","starred_url":"https://api.github.com/users/IngwiePhoenix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IngwiePhoenix/subscriptions","organizations_url":"https://api.github.com/users/IngwiePhoenix/orgs","repos_url":"https://api.github.com/users/IngwiePhoenix/repos","events_url":"https://api.github.com/users/IngwiePhoenix/events{/privacy}","received_events_url":"https://api.github.com/users/IngwiePhoenix/received_events","type":"User","site_admin":false},"labels":[{"id":307036821,"url":"https://api.github.com/repos/feathersjs/feathers/labels/Discussion","name":"Discussion","color":"fad8c7","default":false},{"id":44266050,"url":"https://api.github.com/repos/feathersjs/feathers/labels/Feature","name":"Feature","color":"207de5","default":false},{"id":335682705,"url":"https://api.github.com/repos/feathersjs/feathers/labels/Help%20Wanted","name":"Help Wanted","color":"fef2c0","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-03-16T09:23:04Z","updated_at":"2016-11-08T06:48:55Z","closed_at":"2016-11-08T06:48:55Z","body":"Hello!\n\nOver the time I have been a rare-time contributor to [SocketCluster](https://github.com/SocketCluster/socketcluster) - but that doesnt mean I am actually using it. No; in fact, my whole [bigger project](https://github.com/DragonsInn/BIRD3) is basically centered around it. To give you a few shortnotes on what SocketCluster is:\n- Scale horizontally **and** vertically with ease.\n- Separate worker and broker processes to manage incoming traffic and backend work.\n- Integrated key-value storage: [nData](https://github.com/SocketCluster/nData)\n- Event-based approach, where back- and frontend are synced, even across nodes; heck, you could probably sync two buildings full of serves with this!\n- WebSockets, and no backwards compatibility to older transports - so, its a yes-or-no situation.\n\nThere are a lot more features, which is why I would recommend their [website](http://socketcluster.io/) for more information on the subject.\n\nBut basically, what I will focus on is the worker process - that one has access to HTTP and the WebSockets stuff. And in fact, I can even provide actual code to demonstrate how I am currently using it with Express!\n\nSo first to note is that each process gets a pre-configured HTTP server instance. So Feathers' `.setup()` method is the proper approach in any way, since that is already a given. Instantiating a new server would defeat the purpose of using SC in the first place. This is how you do it: https://github.com/DragonsInn/BIRD3/blob/843736bea08d22316009558b4119df5e1dbf981c/app/Backend/SocketCluster/Worker.js#L17\n\nNext, to get access to the SocketCluster server itself - the WebSockets stuff - we can do so with a separate method too. To see that, just go ~3 lines deeper on the previous link.\n\nNow that these two are gotten, that is basically all that would be required to make Feathers compatible:\n- The user has to use `.setup` instead of `.listen`\n- Feathers needs to learn to speak with SC's Real-Time engine.\n\nIn most - but **not** all cases - it is very similar to that of Socket.IO. But some things are different intentionally - callback layout, for instance - since SC supports stuff like \"answering\" to an event - much like returning data int hat sense. And to see how it is used in its most basic way, see my link above and go towards the bottom; you'll see me setting up a \"ping\" event and an empty \"disconnect\" event. There are more events like authentication. One can provide SC with a custom authentication engine - allowing Feathers to throw itself right in and providing the user with a unified mechanism.\n\nSo, thats as much of my SC introduction. I might try my luck by forking the feathers-socketio component and hacking it into the right way, cleaning it up and returning it. But I would like to see what you think about it! :)\n\nHope my english didn't fail me (I am actually german ^^) and you understood what I wanted to write about. I personally really want to move from plain Express to a more fleshed-out backend service - and Feathers seems to provide that. I really like your error handling, for a start. And the other things I have seen look really interesting as well! So we'll see what comes along.\n\nKind regards,\nIngwie\n"}}
{"actor":{"display_login":"daffl"}}