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

Question: react-native-use-websocket onMessage response different from 'normal' ws response #12

Open
wswebcreation opened this issue Dec 15, 2021 · 1 comment

Comments

@wswebcreation
Copy link

First of all thanks for this great lib!

I'm trying to use react-native-use-websocket in a RN 0.66.3. I know that you can there use the Websocket but for some reason it was failing all the time and this lib didn't.

The WS that I need to connect to responds with a buffer, it's basically streaming images so they can be used to mimic a video.
The challenge I have now is that when I set up a WS and log the onMessage I get back a JSON response, something like this

onMessage =  {"data": [], "isTrusted": false}

But when I use a simple Node script when I use the ws lib and log the result I see the buffer being printed. Is there some reason why this isn't working in the same way? Do I need to configure something else?

Thanks in advance

@wswebcreation
Copy link
Author

Hmm, for some reason I can't seem to change the binaryType to blob which might fix my issue. The docs mention how to change that, but that doesn't work.

Might this be the problem?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant