{"action":"created","issue":{"url":"https://api.github.com/repos/socketio/socket.io-client-swift/issues/36","labels_url":"https://api.github.com/repos/socketio/socket.io-client-swift/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/socketio/socket.io-client-swift/issues/36/comments","events_url":"https://api.github.com/repos/socketio/socket.io-client-swift/issues/36/events","html_url":"https://github.com/socketio/socket.io-client-swift/issues/36","id":64813608,"number":36,"title":"Client connecting multiple times  when proxied through nginx","user":{"login":"KCastiglione","id":96905,"avatar_url":"https://avatars.githubusercontent.com/u/96905?v=3","gravatar_id":"","url":"https://api.github.com/users/KCastiglione","html_url":"https://github.com/KCastiglione","followers_url":"https://api.github.com/users/KCastiglione/followers","following_url":"https://api.github.com/users/KCastiglione/following{/other_user}","gists_url":"https://api.github.com/users/KCastiglione/gists{/gist_id}","starred_url":"https://api.github.com/users/KCastiglione/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KCastiglione/subscriptions","organizations_url":"https://api.github.com/users/KCastiglione/orgs","repos_url":"https://api.github.com/users/KCastiglione/repos","events_url":"https://api.github.com/users/KCastiglione/events{/privacy}","received_events_url":"https://api.github.com/users/KCastiglione/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-27T17:35:01Z","updated_at":"2015-03-27T19:10:37Z","closed_at":null,"body":"Sometimes it connects more than 3 times. If I connect directly to the socket.io it connects only once.\r\n\r\n\r\n\r\nmultiple connects:\r\n\r\n        10.0.1.236 - - [27/Mar/2015:10:27:03 -0700] \"GET /socket.io/?transport=polling&b64=1         HTTP/1.1\" 200 100 \"-\" \"socket/1 CFNetwork/711.2.23 Darwin/14.0.0\"\r\n        10.0.1.236 - - [27/Mar/2015:10:27:03 -0700] \"GET /socket.io/?transport=polling&sid=vb1yUHmUr59l6el6AAAP HTTP/1.1\" 200 4 \"-\" \"socket/1         CFNetwork/711.2.23 Darwin/14.0.0\"\r\n        10.0.1.236 - - [27/Mar/2015:10:27:03 -0700] \"POST /socket.io/?transport=polling&sid=vb1yUHmUr59l6el6AAAP HTTP/1.1\" 400 45 \"-\" \"socket/1         CFNetwork/711.2.23 Darwin/14.0.0\"\r\n        \r\n\r\n\r\n\r\nObjective-C client code:\r\n\r\n\r\n      - (void)viewDidLoad {\r\n          [super viewDidLoad];\r\n          // Do any additional setup after loading the view, typically from a nib.\r\n          socket = [[SocketIOClient alloc] initWithSocketURL:@\"http://socket.xxx.com\"       options:@{@\"nsp\":@\"kwik\"}];\r\n          \r\n          [socket on: @\"connect\" callback: ^(NSArray* data, void (^ack)(NSArray*)) {\r\n              NSLog(@\"connected\");\r\n          \r\n              [socket emitObjc:@\"add-user\" withItems:@[ @{@\"username\":@\"username\"} ] ];\r\n          }];\r\n          [socket on:@\"data\" callback:^(NSArray* data, void (^ack)(NSArray*)) {\r\n              NSLog(@\"data:%@\", data);\r\n          }];\r\n          [socket connect];\r\n      }\r\n\r\n\r\nnginx config:\r\n\r\n    server {\r\n        listen       80;\r\n        server_name socket.xxx.com;\r\n        location /socket.io {\r\n            proxy_pass http://localhost:5000/socket.io;\r\n            proxy_redirect off;\r\n            proxy_buffering off;\r\n\r\n            proxy_set_header Host $host;\r\n            proxy_set_header X-Real-IP $remote_addr;\r\n            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n\r\n            proxy_http_version 1.1;\r\n            proxy_set_header Upgrade $http_upgrade;\r\n            proxy_set_header Connection \"Upgrade\";\r\n        }\r\n    }\r\n"},"comment":{"url":"https://api.github.com/repos/socketio/socket.io-client-swift/issues/comments/87061062","html_url":"https://github.com/socketio/socket.io-client-swift/issues/36#issuecomment-87061062","issue_url":"https://api.github.com/repos/socketio/socket.io-client-swift/issues/36","id":87061062,"user":{"login":"KCastiglione","id":96905,"avatar_url":"https://avatars.githubusercontent.com/u/96905?v=3","gravatar_id":"","url":"https://api.github.com/users/KCastiglione","html_url":"https://github.com/KCastiglione","followers_url":"https://api.github.com/users/KCastiglione/followers","following_url":"https://api.github.com/users/KCastiglione/following{/other_user}","gists_url":"https://api.github.com/users/KCastiglione/gists{/gist_id}","starred_url":"https://api.github.com/users/KCastiglione/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KCastiglione/subscriptions","organizations_url":"https://api.github.com/users/KCastiglione/orgs","repos_url":"https://api.github.com/users/KCastiglione/repos","events_url":"https://api.github.com/users/KCastiglione/events{/privacy}","received_events_url":"https://api.github.com/users/KCastiglione/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T19:10:37Z","updated_at":"2015-03-27T19:10:37Z","body":"yes it works with javascript and also works with https://github.com/pkyeck/socket.IO-objc correctly"}}