{"action":"created","issue":{"url":"https://api.github.com/repos/nuclearace/Socket.IO-Client-Swift/issues/55","labels_url":"https://api.github.com/repos/nuclearace/Socket.IO-Client-Swift/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/nuclearace/Socket.IO-Client-Swift/issues/55/comments","events_url":"https://api.github.com/repos/nuclearace/Socket.IO-Client-Swift/issues/55/events","html_url":"https://github.com/nuclearace/Socket.IO-Client-Swift/issues/55","id":82334601,"number":55,"title":"Will not connect to client when adding a namespace","user":{"login":"ic-tim","id":11782904,"avatar_url":"https://avatars.githubusercontent.com/u/11782904?v=3","gravatar_id":"","url":"https://api.github.com/users/ic-tim","html_url":"https://github.com/ic-tim","followers_url":"https://api.github.com/users/ic-tim/followers","following_url":"https://api.github.com/users/ic-tim/following{/other_user}","gists_url":"https://api.github.com/users/ic-tim/gists{/gist_id}","starred_url":"https://api.github.com/users/ic-tim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ic-tim/subscriptions","organizations_url":"https://api.github.com/users/ic-tim/orgs","repos_url":"https://api.github.com/users/ic-tim/repos","events_url":"https://api.github.com/users/ic-tim/events{/privacy}","received_events_url":"https://api.github.com/users/ic-tim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":22,"created_at":"2015-05-29T08:40:35Z","updated_at":"2015-06-08T13:45:19Z","closed_at":null,"body":"Hi nuclearace,\r\n\r\nI'm trying to implement this library for some weeks now, but facing problems when using a namespace. I tried almost everything to make it work, like different options based on our client, but it just won't connect.\r\n\r\nCode:\r\n```swift\r\nlet socket = SocketIOClient(socketURL: \"ws-xxxx.xxxxx.net\", opts: [\"nsp\":\"chat\", \"log\":true])\r\n```\r\n\r\nThe following things I tried:\r\n* adding portnumber (Engine is being deinit after doing polling request)\r\n* adding \"/chat\" as namespace, gives almost the same feedback as without the slash\r\n\r\nScenario:\r\n* We use Socket.IO client version 1.2\r\n* Without a namespace it connects perfectly, but with a namespace it tries to do a lot of things, see the log below:\r\n* The declaration of the socket happens on the global scope\r\n\r\n> SocketClient: Adding handler for event: connect\r\n> SocketClient: Adding engine\r\n> SocketEngine: Starting engin\r\n> SocketEngine: Handshaking\r\n> SocketEngine: Doing polling request\r\n> SocketEngine: Got polling response\r\n> SocketEngine: Got message: 0{\"sid\":\"xxxxxxxxxxxxxxxxxxxx\",\"upgrades\":[\"websocket\"],\"pingInterval\":25000,\"pingTimeout\":60000}\r\n> SocketEngine: Doing polling request\r\n> SocketEngine: Flushing probe wait\r\n> SocketEngine: Got polling response\r\n> SocketEngine: Got message: 40\r\n> SocketEngine: Doing polling request\r\n> SocketParser: Parsing 0\r\n> SocketParser: Decoded packet as: SocketPacket {type: 0; data: nil; id: nil; placeholders: nil;}\r\n> SocketClient: Joining namespace\r\n> SocketEngine: Writing poll: 0/chat:nil\r\n> SocketEngine: Sending poll: 0/chat as type: 4\r\n> SocketEngine: POSTing: 7:40/chat\r\n> SocketEngine: Writing poll: :nil\r\n> SocketEngine: Sending poll:  as type: 2\r\n> SocketClient: Handling event: reconnect with data: Optional([Ping timeout])\r\n> SocketClient: Starting reconnect\r\n> SocketClient: Trying to reconnect\r\n> SocketClient: Handling event: reconnectAttempt with data: Optional([-1])\r\n\r\nI will be very grateful if you're able to look into the matter. If you need more information, I'll respond very quickly. Thanks in advance!"},"comment":{"url":"https://api.github.com/repos/nuclearace/Socket.IO-Client-Swift/issues/comments/110000993","html_url":"https://github.com/nuclearace/Socket.IO-Client-Swift/issues/55#issuecomment-110000993","issue_url":"https://api.github.com/repos/nuclearace/Socket.IO-Client-Swift/issues/55","id":110000993,"user":{"login":"nuclearace","id":1211049,"avatar_url":"https://avatars.githubusercontent.com/u/1211049?v=3","gravatar_id":"","url":"https://api.github.com/users/nuclearace","html_url":"https://github.com/nuclearace","followers_url":"https://api.github.com/users/nuclearace/followers","following_url":"https://api.github.com/users/nuclearace/following{/other_user}","gists_url":"https://api.github.com/users/nuclearace/gists{/gist_id}","starred_url":"https://api.github.com/users/nuclearace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuclearace/subscriptions","organizations_url":"https://api.github.com/users/nuclearace/orgs","repos_url":"https://api.github.com/users/nuclearace/repos","events_url":"https://api.github.com/users/nuclearace/events{/privacy}","received_events_url":"https://api.github.com/users/nuclearace/received_events","type":"User","site_admin":false},"created_at":"2015-06-08T13:45:19Z","updated_at":"2015-06-08T13:45:19Z","body":"I think the problem was that the server communicated it can upgrade to websockets, so the client tried to upgrade but then your proxy didn't forward the ws stuff. So maybe configure your proxy to forward ws or setup your server to not upgrade to ws"}}