{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/6223","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/6223/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/6223/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/6223/events","html_url":"https://github.com/facebook/react-native/pull/6223","id":137509120,"number":6223,"title":"[WebSocket][Android] Support WebSocket sub-protocols fixes #5810","user":{"login":"zxcpoiu","id":5081771,"avatar_url":"https://avatars.githubusercontent.com/u/5081771?v=3","gravatar_id":"","url":"https://api.github.com/users/zxcpoiu","html_url":"https://github.com/zxcpoiu","followers_url":"https://api.github.com/users/zxcpoiu/followers","following_url":"https://api.github.com/users/zxcpoiu/following{/other_user}","gists_url":"https://api.github.com/users/zxcpoiu/gists{/gist_id}","starred_url":"https://api.github.com/users/zxcpoiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zxcpoiu/subscriptions","organizations_url":"https://api.github.com/users/zxcpoiu/orgs","repos_url":"https://api.github.com/users/zxcpoiu/repos","events_url":"https://api.github.com/users/zxcpoiu/events{/privacy}","received_events_url":"https://api.github.com/users/zxcpoiu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react-native/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7"},{"url":"https://api.github.com/repos/facebook/react-native/labels/GH%20Review:%20review-needed","name":"GH Review: review-needed","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-03-01T08:38:57Z","updated_at":"2016-03-11T14:58:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/6223","html_url":"https://github.com/facebook/react-native/pull/6223","diff_url":"https://github.com/facebook/react-native/pull/6223.diff","patch_url":"https://github.com/facebook/react-native/pull/6223.patch"},"body":"Hey there and thanks for submitting a pull request! Please have a look at the following checklist so that others have enough information to review your pull request:\r\n\r\n**motivation**\r\n\r\nWebSocket spec supports [Sec-WebSocket-Protocol](https://tools.ietf.org/html/rfc6455#section-11.3.4) as a standard way for negotiate a sub protocol between client and server.\r\n\r\n* ios WebSocket implementation supports it.\r\n* android WebSocket implementation ignores this header, leave a comment syas: \"OkHttp will overrides it\", so it did not implement.\r\n* after some test, OkHttp doesn't override the header we add.\r\n\r\n**Test plan (required)**\r\n\r\n1. run and react-native app on android\r\n2. at the main page, invoke: `var ws = new WebSocket('ws://example.ws-service.fakedomain.com', 'my-sub-protocol');`\r\n3. see the header if it send the correct header, ex, use ngrep: `sudo ngrep -t -Wbyline -deth0 host example.ws-service.fakedomain.com and port 80`\r\n\r\nyou should see the WebSocket initial GET handshake includes header:\r\n`Sec-WebSocket-Protocol: my-sub-protocol`\r\nand the value should equals to the value you provided in js.\r\n\r\n...#5810\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/195400871","html_url":"https://github.com/facebook/react-native/pull/6223#issuecomment-195400871","issue_url":"https://api.github.com/repos/facebook/react-native/issues/6223","id":195400871,"user":{"login":"christopherdro","id":3741055,"avatar_url":"https://avatars.githubusercontent.com/u/3741055?v=3","gravatar_id":"","url":"https://api.github.com/users/christopherdro","html_url":"https://github.com/christopherdro","followers_url":"https://api.github.com/users/christopherdro/followers","following_url":"https://api.github.com/users/christopherdro/following{/other_user}","gists_url":"https://api.github.com/users/christopherdro/gists{/gist_id}","starred_url":"https://api.github.com/users/christopherdro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christopherdro/subscriptions","organizations_url":"https://api.github.com/users/christopherdro/orgs","repos_url":"https://api.github.com/users/christopherdro/repos","events_url":"https://api.github.com/users/christopherdro/events{/privacy}","received_events_url":"https://api.github.com/users/christopherdro/received_events","type":"User","site_admin":false},"created_at":"2016-03-11T14:58:18Z","updated_at":"2016-03-11T14:58:18Z","body":"@zxcpoiu Just a heads up that my related PR just got shipped."}}