{"action":"created","issue":{"url":"https://api.github.com/repos/TopCloud/socketcluster/issues/61","labels_url":"https://api.github.com/repos/TopCloud/socketcluster/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/TopCloud/socketcluster/issues/61/comments","events_url":"https://api.github.com/repos/TopCloud/socketcluster/issues/61/events","html_url":"https://github.com/TopCloud/socketcluster/issues/61","id":70930111,"number":61,"title":"\"parser error\" when attempting to connect","user":{"login":"woubuc","id":1015540,"avatar_url":"https://avatars.githubusercontent.com/u/1015540?v=3","gravatar_id":"","url":"https://api.github.com/users/woubuc","html_url":"https://github.com/woubuc","followers_url":"https://api.github.com/users/woubuc/followers","following_url":"https://api.github.com/users/woubuc/following{/other_user}","gists_url":"https://api.github.com/users/woubuc/gists{/gist_id}","starred_url":"https://api.github.com/users/woubuc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woubuc/subscriptions","organizations_url":"https://api.github.com/users/woubuc/orgs","repos_url":"https://api.github.com/users/woubuc/repos","events_url":"https://api.github.com/users/woubuc/events{/privacy}","received_events_url":"https://api.github.com/users/woubuc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-25T15:52:00Z","updated_at":"2015-04-26T08:51:42Z","closed_at":null,"body":"I'm developing a server for a multiplayer game, and decided to implement SocketCluster instead of socket.io which I previously used, since it does exactly what I need in terms of scaling. I have v2 set up and the server starts up and runs, using 6 workers, a balancer and a store process. My code is basically the example code (in coffeescript):\r\n\r\n    # Server (app.js)\r\n    cluster = new SocketCluster\r\n    \tappName: 'planets'\r\n    \tport: 8000\r\n    \tbalancers: 1\r\n    \tstores: 1\r\n    \tworkers: 6\r\n    \tworkerController: './server.js'\r\n    \ttransports: ['websocket']\r\n    \tlogLevel: 3\r\n\r\n    # Worker (server.js)\r\n    app = do express\r\n    httpServer = do worker.getHTTPServer\r\n    socketServer = do worker.getSCServer\r\n    \r\n    httpServer.on 'request', app\r\n    \r\n    socketServer.on 'connection', (socket) ->\r\n    \tconsole.log 'Someone wants to say hi!'\r\n\r\nAnd on the client, from the socketcluster-client example code:\r\n\r\n    var options = {\r\n    \thost: '127.0.0.1',\r\n    \tport: 8000,\r\n    \ttransports: ['websocket']\r\n    }\r\n    var socket = socketCluster.connect(options);\r\n    socket.on('connect', function() {\r\n    \tconsole.log('Connected!');\r\n    });\r\n\r\nThe client runs inside a nw.js window so I know it supports websockets, which is why I disabled polling. When I open it, it starts connecting to the server (I see the 'someone wants to say hi' log appear on the server), but then I get back a 'server error'. Closer inspection showed it was a 'parser error', but beyond that I couldn't really find what the problem was.\r\n\r\nAm I just doing something wrong or is this a bug?"},"comment":{"url":"https://api.github.com/repos/TopCloud/socketcluster/issues/comments/96344740","html_url":"https://github.com/TopCloud/socketcluster/issues/61#issuecomment-96344740","issue_url":"https://api.github.com/repos/TopCloud/socketcluster/issues/61","id":96344740,"user":{"login":"woubuc","id":1015540,"avatar_url":"https://avatars.githubusercontent.com/u/1015540?v=3","gravatar_id":"","url":"https://api.github.com/users/woubuc","html_url":"https://github.com/woubuc","followers_url":"https://api.github.com/users/woubuc/followers","following_url":"https://api.github.com/users/woubuc/following{/other_user}","gists_url":"https://api.github.com/users/woubuc/gists{/gist_id}","starred_url":"https://api.github.com/users/woubuc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woubuc/subscriptions","organizations_url":"https://api.github.com/users/woubuc/orgs","repos_url":"https://api.github.com/users/woubuc/repos","events_url":"https://api.github.com/users/woubuc/events{/privacy}","received_events_url":"https://api.github.com/users/woubuc/received_events","type":"User","site_admin":false},"created_at":"2015-04-26T08:51:42Z","updated_at":"2015-04-26T08:51:42Z","body":"@jondubois I installed it like that in an empty directory and copied the correct js file to my client, since I don't need all the other stuff. It now works perfectly :smiley: \r\n\r\nFor libraries I need in my client I usually just go to the github repo and download the js file from there, since that's all I really need. But there was no sc2-client repo that I could find so that's what confused me. I just needed that one js file to include in the client nwjs project, not the rest of the default setup, since I'm implementing socketcluster in existing code both server and client side (which used to use socket.io so a lot of the code is similar). So for my server I didn't install the default project either, I just installed the sc2 module and got what I needed for implementation from the docs. So perhaps you could offer the sc2 client files separately as well, instead of having to install it like that?\r\n\r\nIf most people already use sc2, it does sound like it may be time to make that the major version. But, do keep the original one alive as well, don't just pull the plug on it, in case people need a library that can fallback to polling (for web applications or simple web games that have to support older browsers)."}}