{"action":"created","comment":{"url":"https://api.github.com/repos/rails/rails/pulls/comments/56572273","id":56572273,"diff_hunk":"@@ -35,7 +35,8 @@ module ActionCable\n       confirmation: 'confirm_subscription'.freeze,\n       rejection: 'reject_subscription'.freeze\n     },\n-    default_mount_path: '/cable'.freeze\n+    default_mount_path: '/cable'.freeze,\n+    protocols: [\"actioncable-v1-json\".freeze].freeze","path":"actioncable/lib/action_cable.rb","position":6,"original_position":6,"commit_id":"3545daf7e2621dab09dc312ed5ae96b8d70e44b8","original_commit_id":"3545daf7e2621dab09dc312ed5ae96b8d70e44b8","user":{"login":"maclover7","id":3020626,"avatar_url":"https://avatars.githubusercontent.com/u/3020626?v=3","gravatar_id":"","url":"https://api.github.com/users/maclover7","html_url":"https://github.com/maclover7","followers_url":"https://api.github.com/users/maclover7/followers","following_url":"https://api.github.com/users/maclover7/following{/other_user}","gists_url":"https://api.github.com/users/maclover7/gists{/gist_id}","starred_url":"https://api.github.com/users/maclover7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maclover7/subscriptions","organizations_url":"https://api.github.com/users/maclover7/orgs","repos_url":"https://api.github.com/users/maclover7/repos","events_url":"https://api.github.com/users/maclover7/events{/privacy}","received_events_url":"https://api.github.com/users/maclover7/received_events","type":"User","site_admin":false},"body":"Isn't there only supposed to be one protocol here? Not sure why we need an array :grimacing: ","created_at":"2016-03-17T20:29:24Z","updated_at":"2016-03-17T20:29:24Z","html_url":"https://github.com/rails/rails/pull/24224#discussion_r56572273","pull_request_url":"https://api.github.com/repos/rails/rails/pulls/24224","_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/56572273"},"html":{"href":"https://github.com/rails/rails/pull/24224#discussion_r56572273"},"pull_request":{"href":"https://api.github.com/repos/rails/rails/pulls/24224"}}},"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/24224","id":63230449,"html_url":"https://github.com/rails/rails/pull/24224","diff_url":"https://github.com/rails/rails/pull/24224.diff","patch_url":"https://github.com/rails/rails/pull/24224.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/24224","number":24224,"state":"open","locked":false,"title":"ActionCable protocol negotiation","user":{"login":"danielrhodes","id":120044,"avatar_url":"https://avatars.githubusercontent.com/u/120044?v=3","gravatar_id":"","url":"https://api.github.com/users/danielrhodes","html_url":"https://github.com/danielrhodes","followers_url":"https://api.github.com/users/danielrhodes/followers","following_url":"https://api.github.com/users/danielrhodes/following{/other_user}","gists_url":"https://api.github.com/users/danielrhodes/gists{/gist_id}","starred_url":"https://api.github.com/users/danielrhodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielrhodes/subscriptions","organizations_url":"https://api.github.com/users/danielrhodes/orgs","repos_url":"https://api.github.com/users/danielrhodes/repos","events_url":"https://api.github.com/users/danielrhodes/events{/privacy}","received_events_url":"https://api.github.com/users/danielrhodes/received_events","type":"User","site_admin":false},"body":"A first stab at negotiating an acceptable protocol as was mentioned in #23976 @maclover7 @jeremy @javan\r\n\r\nGoing forward, if the ActionCable protocol changes, there ought to be some way for the client/server to negotiate this change and gracefully stop communicating if no common protocol can be established.\r\n\r\nUsing the `Sec-Websocket-Protocol` from the [WebSocket spec](https://tools.ietf.org/html/rfc6455#page-59), the client and server negotiate a protocol from a list. Most of the work is being done by the [WebSocket driver](https://github.com/faye/websocket-driver-ruby/blob/master/lib/websocket/driver/hybi.rb#L76) and the web browser WebSocket client, so all this really does is make sure the client does not get into a bad state if the server has been upgraded and the client has not.\r\n\r\nThe browser websocket client automatically chooses to disconnect if the server does not respond with an acceptable protocol (this is not configurable), so instead of trying to reconnect (as this would not be useful), the client shuts down the monitor.","created_at":"2016-03-17T14:24:49Z","updated_at":"2016-03-17T20:29:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c8d9227db9365fe10f79d50e888712bcfb150c8","assignee":{"login":"arthurnn","id":833383,"avatar_url":"https://avatars.githubusercontent.com/u/833383?v=3","gravatar_id":"","url":"https://api.github.com/users/arthurnn","html_url":"https://github.com/arthurnn","followers_url":"https://api.github.com/users/arthurnn/followers","following_url":"https://api.github.com/users/arthurnn/following{/other_user}","gists_url":"https://api.github.com/users/arthurnn/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurnn/subscriptions","organizations_url":"https://api.github.com/users/arthurnn/orgs","repos_url":"https://api.github.com/users/arthurnn/repos","events_url":"https://api.github.com/users/arthurnn/events{/privacy}","received_events_url":"https://api.github.com/users/arthurnn/received_events","type":"User","site_admin":true},"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/24224/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/24224/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/24224/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/3545daf7e2621dab09dc312ed5ae96b8d70e44b8","head":{"label":"danielrhodes:actioncable-websocket-protocols","ref":"actioncable-websocket-protocols","sha":"3545daf7e2621dab09dc312ed5ae96b8d70e44b8","user":{"login":"danielrhodes","id":120044,"avatar_url":"https://avatars.githubusercontent.com/u/120044?v=3","gravatar_id":"","url":"https://api.github.com/users/danielrhodes","html_url":"https://github.com/danielrhodes","followers_url":"https://api.github.com/users/danielrhodes/followers","following_url":"https://api.github.com/users/danielrhodes/following{/other_user}","gists_url":"https://api.github.com/users/danielrhodes/gists{/gist_id}","starred_url":"https://api.github.com/users/danielrhodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielrhodes/subscriptions","organizations_url":"https://api.github.com/users/danielrhodes/orgs","repos_url":"https://api.github.com/users/danielrhodes/repos","events_url":"https://api.github.com/users/danielrhodes/events{/privacy}","received_events_url":"https://api.github.com/users/danielrhodes/received_events","type":"User","site_admin":false},"repo":{"id":52435623,"name":"rails","full_name":"danielrhodes/rails","owner":{"login":"danielrhodes","id":120044,"avatar_url":"https://avatars.githubusercontent.com/u/120044?v=3","gravatar_id":"","url":"https://api.github.com/users/danielrhodes","html_url":"https://github.com/danielrhodes","followers_url":"https://api.github.com/users/danielrhodes/followers","following_url":"https://api.github.com/users/danielrhodes/following{/other_user}","gists_url":"https://api.github.com/users/danielrhodes/gists{/gist_id}","starred_url":"https://api.github.com/users/danielrhodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielrhodes/subscriptions","organizations_url":"https://api.github.com/users/danielrhodes/orgs","repos_url":"https://api.github.com/users/danielrhodes/repos","events_url":"https://api.github.com/users/danielrhodes/events{/privacy}","received_events_url":"https://api.github.com/users/danielrhodes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danielrhodes/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/danielrhodes/rails","forks_url":"https://api.github.com/repos/danielrhodes/rails/forks","keys_url":"https://api.github.com/repos/danielrhodes/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danielrhodes/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danielrhodes/rails/teams","hooks_url":"https://api.github.com/repos/danielrhodes/rails/hooks","issue_events_url":"https://api.github.com/repos/danielrhodes/rails/issues/events{/number}","events_url":"https://api.github.com/repos/danielrhodes/rails/events","assignees_url":"https://api.github.com/repos/danielrhodes/rails/assignees{/user}","branches_url":"https://api.github.com/repos/danielrhodes/rails/branches{/branch}","tags_url":"https://api.github.com/repos/danielrhodes/rails/tags","blobs_url":"https://api.github.com/repos/danielrhodes/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danielrhodes/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danielrhodes/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/danielrhodes/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danielrhodes/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/danielrhodes/rails/languages","stargazers_url":"https://api.github.com/repos/danielrhodes/rails/stargazers","contributors_url":"https://api.github.com/repos/danielrhodes/rails/contributors","subscribers_url":"https://api.github.com/repos/danielrhodes/rails/subscribers","subscription_url":"https://api.github.com/repos/danielrhodes/rails/subscription","commits_url":"https://api.github.com/repos/danielrhodes/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/danielrhodes/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/danielrhodes/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/danielrhodes/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/danielrhodes/rails/contents/{+path}","compare_url":"https://api.github.com/repos/danielrhodes/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danielrhodes/rails/merges","archive_url":"https://api.github.com/repos/danielrhodes/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danielrhodes/rails/downloads","issues_url":"https://api.github.com/repos/danielrhodes/rails/issues{/number}","pulls_url":"https://api.github.com/repos/danielrhodes/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/danielrhodes/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/danielrhodes/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danielrhodes/rails/labels{/name}","releases_url":"https://api.github.com/repos/danielrhodes/rails/releases{/id}","deployments_url":"https://api.github.com/repos/danielrhodes/rails/deployments","created_at":"2016-02-24T10:56:02Z","updated_at":"2016-02-24T10:57:05Z","pushed_at":"2016-03-17T19:56:47Z","git_url":"git://github.com/danielrhodes/rails.git","ssh_url":"git@github.com:danielrhodes/rails.git","clone_url":"https://github.com/danielrhodes/rails.git","svn_url":"https://github.com/danielrhodes/rails","homepage":"http://rubyonrails.org","size":128506,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rails:master","ref":"master","sha":"47c0a3990a44bbf678e06605eb77f000147dac70","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":8514,"name":"rails","full_name":"rails/rails","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails","description":"Ruby on Rails","fork":false,"url":"https://api.github.com/repos/rails/rails","forks_url":"https://api.github.com/repos/rails/rails/forks","keys_url":"https://api.github.com/repos/rails/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails/teams","hooks_url":"https://api.github.com/repos/rails/rails/hooks","issue_events_url":"https://api.github.com/repos/rails/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails/events","assignees_url":"https://api.github.com/repos/rails/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails/tags","blobs_url":"https://api.github.com/repos/rails/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails/languages","stargazers_url":"https://api.github.com/repos/rails/rails/stargazers","contributors_url":"https://api.github.com/repos/rails/rails/contributors","subscribers_url":"https://api.github.com/repos/rails/rails/subscribers","subscription_url":"https://api.github.com/repos/rails/rails/subscription","commits_url":"https://api.github.com/repos/rails/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails/merges","archive_url":"https://api.github.com/repos/rails/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails/downloads","issues_url":"https://api.github.com/repos/rails/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails/releases{/id}","deployments_url":"https://api.github.com/repos/rails/rails/deployments","created_at":"2008-04-11T02:19:47Z","updated_at":"2016-03-17T20:14:28Z","pushed_at":"2016-03-17T20:25:09Z","git_url":"git://github.com/rails/rails.git","ssh_url":"git@github.com:rails/rails.git","clone_url":"https://github.com/rails/rails.git","svn_url":"https://github.com/rails/rails","homepage":"http://rubyonrails.org","size":329475,"stargazers_count":30223,"watchers_count":30223,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12260,"mirror_url":null,"open_issues_count":902,"forks":12260,"open_issues":902,"watchers":30223,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/24224"},"html":{"href":"https://github.com/rails/rails/pull/24224"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/24224"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/24224/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/24224/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/24224/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/3545daf7e2621dab09dc312ed5ae96b8d70e44b8"}}}}