{"action":"created","issue":{"url":"https://api.github.com/repos/faye/faye-websocket-ruby/issues/87","repository_url":"https://api.github.com/repos/faye/faye-websocket-ruby","labels_url":"https://api.github.com/repos/faye/faye-websocket-ruby/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/faye/faye-websocket-ruby/issues/87/comments","events_url":"https://api.github.com/repos/faye/faye-websocket-ruby/issues/87/events","html_url":"https://github.com/faye/faye-websocket-ruby/issues/87","id":131923562,"number":87,"title":"The example in the Readme fails for a generic Hijack capable server (Iodine)","user":{"login":"boazsegev","id":870622,"avatar_url":"https://avatars.githubusercontent.com/u/870622?v=3","gravatar_id":"","url":"https://api.github.com/users/boazsegev","html_url":"https://github.com/boazsegev","followers_url":"https://api.github.com/users/boazsegev/followers","following_url":"https://api.github.com/users/boazsegev/following{/other_user}","gists_url":"https://api.github.com/users/boazsegev/gists{/gist_id}","starred_url":"https://api.github.com/users/boazsegev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boazsegev/subscriptions","organizations_url":"https://api.github.com/users/boazsegev/orgs","repos_url":"https://api.github.com/users/boazsegev/repos","events_url":"https://api.github.com/users/boazsegev/events{/privacy}","received_events_url":"https://api.github.com/users/boazsegev/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-02-07T02:17:50Z","updated_at":"2016-02-07T13:55:09Z","closed_at":"2016-02-07T13:35:01Z","body":"Hi James,\r\n\r\nI was trying out the example in the Readme file (the code for the `config.ru` is at the bottom) and it failed when using Thin.\r\n\r\nThe reason I was trying it out is because I'm developing a web server for my Ruby pet project ([Iodine](https://github.com/boazsegev/iodine)) and I wanted to make sure it supported Faye... after Faye websockets failed persistently, I tested Faye with Thin and Puma as well.\r\n\r\nThese are my results:\r\n\r\nThin (which is officially stated as supported), fails with:\r\n`WebSocket connection to 'ws://localhost:3000/' failed: Error during WebSocket handshake: 'Upgrade' header is missing`\r\n\r\nIodine, fails with:\r\n`WebSocket connection to 'ws://localhost:3000/' failed: Error during WebSocket handshake: 'Sec-WebSocket-Accept' header is missing`\r\n(maybe a similar issue?)\r\n\r\nPuma / Rainbows / Passenger:\r\nSuccess.\r\n\r\nThis is the code I used (`config.ru`):\r\n\r\n```ruby\r\nrequire 'rack'\r\nrequire 'faye/websocket'\r\n\r\nrack_app = lambda do |env|\r\n  if Faye::WebSocket.websocket?(env)\r\n    ws = Faye::WebSocket.new(env)\r\n\r\n    ws.on :message do |event|\r\n      ws.send(event.data.to_s)\r\n    end\r\n\r\n    ws.on :close do |event|\r\n      p [:close, event.code, event.reason]\r\n      ws = nil\r\n    end\r\n\r\n    # Return async Rack response\r\n    ws.rack_response\r\n\r\n  else\r\n    # Normal HTTP request\r\n    [200, {'Content-Type' => 'text/plain'}, [\"Hello\\n\"]]\r\n  end\r\nend\r\n\r\nrun rack_app\r\n```\r\n\r\nIf it was only the server I was writing, I would keep looking for issues with my `hijack` implementation... however, since `thin` is also causing errors, I thought you might have a look."},"comment":{"url":"https://api.github.com/repos/faye/faye-websocket-ruby/issues/comments/181020177","html_url":"https://github.com/faye/faye-websocket-ruby/issues/87#issuecomment-181020177","issue_url":"https://api.github.com/repos/faye/faye-websocket-ruby/issues/87","id":181020177,"user":{"login":"jcoglan","id":9265,"avatar_url":"https://avatars.githubusercontent.com/u/9265?v=3","gravatar_id":"","url":"https://api.github.com/users/jcoglan","html_url":"https://github.com/jcoglan","followers_url":"https://api.github.com/users/jcoglan/followers","following_url":"https://api.github.com/users/jcoglan/following{/other_user}","gists_url":"https://api.github.com/users/jcoglan/gists{/gist_id}","starred_url":"https://api.github.com/users/jcoglan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcoglan/subscriptions","organizations_url":"https://api.github.com/users/jcoglan/orgs","repos_url":"https://api.github.com/users/jcoglan/repos","events_url":"https://api.github.com/users/jcoglan/events{/privacy}","received_events_url":"https://api.github.com/users/jcoglan/received_events","type":"User","site_admin":false},"created_at":"2016-02-07T13:55:09Z","updated_at":"2016-02-07T13:55:09Z","body":":tada: "}}