{"action":"created","issue":{"url":"https://api.github.com/repos/socketio/socket.io/issues/2204","labels_url":"https://api.github.com/repos/socketio/socket.io/issues/2204/labels{/name}","comments_url":"https://api.github.com/repos/socketio/socket.io/issues/2204/comments","events_url":"https://api.github.com/repos/socketio/socket.io/issues/2204/events","html_url":"https://github.com/socketio/socket.io/issues/2204","id":101012159,"number":2204,"title":"When in polling mode, client doesn't receive middleware errors.","user":{"login":"JohnyDays","id":4540763,"avatar_url":"https://avatars.githubusercontent.com/u/4540763?v=3","gravatar_id":"","url":"https://api.github.com/users/JohnyDays","html_url":"https://github.com/JohnyDays","followers_url":"https://api.github.com/users/JohnyDays/followers","following_url":"https://api.github.com/users/JohnyDays/following{/other_user}","gists_url":"https://api.github.com/users/JohnyDays/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnyDays/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnyDays/subscriptions","organizations_url":"https://api.github.com/users/JohnyDays/orgs","repos_url":"https://api.github.com/users/JohnyDays/repos","events_url":"https://api.github.com/users/JohnyDays/events{/privacy}","received_events_url":"https://api.github.com/users/JohnyDays/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-14T13:38:47Z","updated_at":"2015-10-09T14:06:25Z","closed_at":null,"body":"Client tries to connect -> Server middleware calls next(error) -> Client doesn't trigger on('error') and keeps trying to connect.\r\nIf we are in websocket mode, this problem doesn't occur"},"comment":{"url":"https://api.github.com/repos/socketio/socket.io/issues/comments/146880837","html_url":"https://github.com/socketio/socket.io/issues/2204#issuecomment-146880837","issue_url":"https://api.github.com/repos/socketio/socket.io/issues/2204","id":146880837,"user":{"login":"darrachequesne","id":13031701,"avatar_url":"https://avatars.githubusercontent.com/u/13031701?v=3","gravatar_id":"","url":"https://api.github.com/users/darrachequesne","html_url":"https://github.com/darrachequesne","followers_url":"https://api.github.com/users/darrachequesne/followers","following_url":"https://api.github.com/users/darrachequesne/following{/other_user}","gists_url":"https://api.github.com/users/darrachequesne/gists{/gist_id}","starred_url":"https://api.github.com/users/darrachequesne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darrachequesne/subscriptions","organizations_url":"https://api.github.com/users/darrachequesne/orgs","repos_url":"https://api.github.com/users/darrachequesne/repos","events_url":"https://api.github.com/users/darrachequesne/events{/privacy}","received_events_url":"https://api.github.com/users/darrachequesne/received_events","type":"User","site_admin":false},"created_at":"2015-10-09T14:06:25Z","updated_at":"2015-10-09T14:06:25Z","body":"Hi! I haven't been able to reproduce the issue with the following code:\r\n```javascript\r\nvar cluster = require('cluster'),\r\n  server = require('socket.io')(),\r\n  client = require('socket.io-client');\r\n\r\nif (cluster.isMaster) {\r\n  server.listen(8181);\r\n  server.use(function(socket, next){\r\n    console.log('[server] middleware called');\r\n    next(new Error('thou shall not pass'));\r\n  });\r\n  cluster.fork();\r\n} else {\r\n  var socket = client('http://localhost:' + '8181', { 'transports': [ 'polling' ] });\r\n  socket.on('error', function () {\r\n    console.log('[client] error');\r\n  });\r\n  socket.on('connect', function () {\r\n    console.log('[client] connect');\r\n  });\r\n}\r\n// output:\r\n// [server] middleware called\r\n// [client] error\r\n``` \r\nnode@0.12.7 / socket.io@1.3.5 / socket.io-client@1.3.5 (also tested with version 1.3.7)\r\n\r\nAre you having this issue in a particular browser?"}}