Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Documentation on sending binary data? #66

Closed
d33tah opened this issue Oct 17, 2018 · 3 comments
Closed

Documentation on sending binary data? #66

d33tah opened this issue Oct 17, 2018 · 3 comments

Comments

@d33tah
Copy link

d33tah commented Oct 17, 2018

I'd like to send binary data using this library, but I have no idea how to get there. So far I'm only getting encoding errors - probably because it's assumed that I'm sending ASCII strings. How to get around that?

@colin-riddell
Copy link

You may be able to provide socket.send() the argument Binary=True.
Eg:

socket.send(payload,  Binary=True)

@colin-riddell
Copy link

Yes! Seems like you can. Ref: https://github.com/jgelens/gevent-websocket/blob/93d6b72a49742cfd615cc102a4c628acf2568465/geventwebsocket/websocket.py#L339

flask-sockets uses gevent-websocket interface thus uses their .send

@d33tah
Copy link
Author

d33tah commented Oct 17, 2018

Awesome, thanks!

@d33tah d33tah closed this as completed Oct 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants