Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WebSocket] Add support for binary type data (ArrayBuffer) #4483

Closed
wants to merge 1 commit into from

Conversation

lindskogen
Copy link
Contributor

Entirely based on #1829
I just updated the diff to be compatible with the current master branch.

@facebook-github-bot
Copy link
Contributor

By analyzing the blame information on this pull request, we identified @satya164, @hharnisc and @tadeuzagallo to be potential reviewers.

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 2, 2015
@alexkrolick
Copy link
Contributor

This just encodes the binary buffer as a string using base64. Unless the server is expecting base64-encoded data, this won't help.

@lindskogen
Copy link
Contributor Author

Actually, it returns an ArrayBuffer

@alexkrolick
Copy link
Contributor

Woops, 👍. Is it possible to extend this for

  • Android
  • sending messages?

@lindskogen
Copy link
Contributor Author

@whokilledtheelectricmonk Does binary data make android crash too?

@nicklockwood
Copy link
Contributor

@facebook-github-bot shipit

@facebook-github-bot
Copy link
Contributor

Thanks for importing. If you are an FB employee go to https://our.intern.facebook.com/intern/opensource/github/pull_request/946334525447643/int_phab to review.

@mkonicek
Copy link
Contributor

This one has successfully landed internally. Will be closed once the export is fixed.

@ghost ghost closed this in afbff9b Dec 23, 2015
philikon added a commit to philikon/react-native that referenced this pull request Apr 7, 2016
…rayBuffer)

This brings the same functionality that's already present on iOS, introduced in facebook#4483, to Android: convert binary payloads to base64 strings and send them to JS land that way, where they'll be turned into an ArrayBuffer.
philikon added a commit to philikon/react-native that referenced this pull request Apr 13, 2016
…rayBuffer)

This brings the same functionality that's already present on iOS, introduced in facebook#4483, to Android: convert binary payloads to base64 strings and send them to JS land that way, where they'll be turned into an ArrayBuffer.
philikon added a commit to philikon/react-native that referenced this pull request Apr 17, 2016
…rayBuffer)

This brings the same functionality that's already present on iOS, introduced in facebook#4483, to Android: convert binary payloads to base64 strings and send them to JS land that way, where they'll be turned into an ArrayBuffer.
ghost pushed a commit that referenced this pull request Apr 18, 2016
Summary:This brings the same functionality that's already present on iOS, introduced in #4483, to Android: convert binary payloads to base64 strings and send them to JS land that way, where they'll be turned into an ArrayBuffer.

**Test Plan:** Used test server from #6889 (in `--binary` mode) to send some binary data to the Android UIExplorer example (also from #6889). Verified it's received correctly as `ArrayBuffer`.
Closes #6868

Differential Revision: D3184797

Pulled By: mkonicek

fb-gh-sync-id: e78c640c43b3e41a75ddba79acc04e5eaab5667d
fbshipit-source-id: e78c640c43b3e41a75ddba79acc04e5eaab5667d
ptmt pushed a commit to ptmt/react-native that referenced this pull request May 9, 2016
Summary:This brings the same functionality that's already present on iOS, introduced in facebook#4483, to Android: convert binary payloads to base64 strings and send them to JS land that way, where they'll be turned into an ArrayBuffer.

**Test Plan:** Used test server from facebook#6889 (in `--binary` mode) to send some binary data to the Android UIExplorer example (also from facebook#6889). Verified it's received correctly as `ArrayBuffer`.
Closes facebook#6868

Differential Revision: D3184797

Pulled By: mkonicek

fb-gh-sync-id: e78c640c43b3e41a75ddba79acc04e5eaab5667d
fbshipit-source-id: e78c640c43b3e41a75ddba79acc04e5eaab5667d
zebulgar pushed a commit to nightingale/react-native that referenced this pull request Jun 18, 2016
Summary:This brings the same functionality that's already present on iOS, introduced in facebook#4483, to Android: convert binary payloads to base64 strings and send them to JS land that way, where they'll be turned into an ArrayBuffer.

**Test Plan:** Used test server from facebook#6889 (in `--binary` mode) to send some binary data to the Android UIExplorer example (also from facebook#6889). Verified it's received correctly as `ArrayBuffer`.
Closes facebook#6868

Differential Revision: D3184797

Pulled By: mkonicek

fb-gh-sync-id: e78c640c43b3e41a75ddba79acc04e5eaab5667d
fbshipit-source-id: e78c640c43b3e41a75ddba79acc04e5eaab5667d
@saulshanabrook
Copy link

Did this add support for array buffers on android as well?

samerce pushed a commit to iodine/react-native that referenced this pull request Aug 23, 2016
Summary:This brings the same functionality that's already present on iOS, introduced in facebook#4483, to Android: convert binary payloads to base64 strings and send them to JS land that way, where they'll be turned into an ArrayBuffer.

**Test Plan:** Used test server from facebook#6889 (in `--binary` mode) to send some binary data to the Android UIExplorer example (also from facebook#6889). Verified it's received correctly as `ArrayBuffer`.
Closes facebook#6868

Differential Revision: D3184797

Pulled By: mkonicek

fb-gh-sync-id: e78c640c43b3e41a75ddba79acc04e5eaab5667d
fbshipit-source-id: e78c640c43b3e41a75ddba79acc04e5eaab5667d
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants