{"action":"created","issue":{"url":"https://api.github.com/repos/SocketCluster/socketcluster/issues/107","labels_url":"https://api.github.com/repos/SocketCluster/socketcluster/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/SocketCluster/socketcluster/issues/107/comments","events_url":"https://api.github.com/repos/SocketCluster/socketcluster/issues/107/events","html_url":"https://github.com/SocketCluster/socketcluster/issues/107","id":104395037,"number":107,"title":"Socket Error: Did not receive #handshake from client before timeout","user":{"login":"McFarts","id":13074002,"avatar_url":"https://avatars.githubusercontent.com/u/13074002?v=3","gravatar_id":"","url":"https://api.github.com/users/McFarts","html_url":"https://github.com/McFarts","followers_url":"https://api.github.com/users/McFarts/followers","following_url":"https://api.github.com/users/McFarts/following{/other_user}","gists_url":"https://api.github.com/users/McFarts/gists{/gist_id}","starred_url":"https://api.github.com/users/McFarts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/McFarts/subscriptions","organizations_url":"https://api.github.com/users/McFarts/orgs","repos_url":"https://api.github.com/users/McFarts/repos","events_url":"https://api.github.com/users/McFarts/events{/privacy}","received_events_url":"https://api.github.com/users/McFarts/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-09-02T03:21:41Z","updated_at":"2015-10-31T11:04:13Z","closed_at":"2015-10-31T11:04:13Z","body":"I keep getting:\r\n```\r\n [Notice] Error: Socket Error: Did not receive #handshake from client before\r\ntimeout\r\n```\r\n\r\nMy worker.js:\r\n```\r\nmodule.exports.run = function (worker) {\r\n  console.log('   >> Worker PID:', process.pid);\r\n  \r\n  //var app = require('express')();\r\n  \r\n  //var httpServer = worker.httpServer;\r\n  var scServer = worker.scServer;\r\n  \r\n // app.use(serveStatic(path.resolve(__dirname, 'public')));\r\n\r\n  //httpServer.on('request', app);\r\n\r\n  var count = 0;\r\n\r\n  /*\r\n    In here we handle our incoming realtime connections and listen for events.\r\n  */\r\n  scServer.on('connection', function (socket) {\r\n  \r\n\t//console.log(socket);\r\n\t\r\n    // Some sample logic to show how to handle client events,\r\n    // replace this with your own logic\r\n   socket.emit('ping', {message: 'This is an object with a message property'});\r\n\t\r\n\t\r\n\t/*\r\n    socket.on('sampleClientEvent', function (data) {\r\n      count++;\r\n      console.log('Handled sampleClientEvent', data);\r\n      scServer.global.publish('sample', count);\r\n    });\r\n    \r\n\r\n    var interval = setInterval(function () {\r\n      socket.emit('rand', {\r\n        rand: Math.floor(Math.random() * 5)\r\n      });\r\n    }, 1000);\r\n    \r\n    socket.on('disconnect', function () {\r\n      clearInterval(interval);\r\n    });\r\n\t\r\n\t*/\r\n\t\r\n\tsocket.send('hello');\r\n\t\r\n\t\r\n\t\r\n  });\r\n};\r\n```\r\n\r\nand server.js:\r\n```\r\nvar SocketCluster = require('socketcluster').SocketCluster;\r\nvar numCPUs = require('os').cpus().length;\r\n\r\n\r\n\r\nvar socketCluster = new SocketCluster({\r\n  workers: numCPUs, // Number of worker processes\r\n  brokers: 1, // Number of broker processes\r\n  port: 9300, // The port number on which your server should listen\r\n  appName: 'myapp', // A unique name for your app\r\n\r\n  /* A JS file which you can use to configure each of your \r\n   * workers/servers - This is where most of your backend code should go\r\n   */\r\n  workerController: __dirname + '/worker.js',\r\n\r\n  /* JS file which you can use to configure each of your \r\n   * brokers - Useful for scaling horizontally across multiple machines (optional)\r\n   */ \r\n  // brokerController: __dirname + '/broker.js',\r\n  \r\n  \r\n  \r\n  \r\n  \r\n\r\n  // Whether or not to reboot the worker in case it crashes (defaults to true)\r\n  rebootWorkerOnCrash: true\r\n});\r\n```\r\n\r\nI don't use express as this is only a gameserver.  Any idea? :)"},"comment":{"url":"https://api.github.com/repos/SocketCluster/socketcluster/issues/comments/152723657","html_url":"https://github.com/SocketCluster/socketcluster/issues/107#issuecomment-152723657","issue_url":"https://api.github.com/repos/SocketCluster/socketcluster/issues/107","id":152723657,"user":{"login":"jondubois","id":1187447,"avatar_url":"https://avatars.githubusercontent.com/u/1187447?v=3","gravatar_id":"","url":"https://api.github.com/users/jondubois","html_url":"https://github.com/jondubois","followers_url":"https://api.github.com/users/jondubois/followers","following_url":"https://api.github.com/users/jondubois/following{/other_user}","gists_url":"https://api.github.com/users/jondubois/gists{/gist_id}","starred_url":"https://api.github.com/users/jondubois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jondubois/subscriptions","organizations_url":"https://api.github.com/users/jondubois/orgs","repos_url":"https://api.github.com/users/jondubois/repos","events_url":"https://api.github.com/users/jondubois/events{/privacy}","received_events_url":"https://api.github.com/users/jondubois/received_events","type":"User","site_admin":false},"created_at":"2015-10-31T11:04:13Z","updated_at":"2015-10-31T11:04:13Z","body":"@tilleps Nice catch. Fixed in v2.3.17."}}