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

Provide info whether websocket_recv'ed message is binary or not #1167

Open
venthur opened this issue Jan 27, 2016 · 5 comments
Open

Provide info whether websocket_recv'ed message is binary or not #1167

venthur opened this issue Jan 27, 2016 · 5 comments

Comments

@venthur
Copy link

venthur commented Jan 27, 2016

Hi,

this bug is related to #1160 (autobahn testsuite failing for fragmented messages). For the echoserver provided in #1160 the testsuite fails also for a lot of unicode-, text- and binary related messages. The problem is, that the server has to guess wether the client sent binary or not. My solution is to try to decode the message and catch any UnicodeDecodeErrors and assume its binary then. But websocket_recv should really provide the info weather the message is binary or not. Since this distinction is made somewhere in the websocket protocol you can just forward this information. Otherwise there is no reliable way to guess weather a message is binary or text.

The autobahn websocket implementation provides this message is_binary along with the message.

@venthur venthur changed the title Provode info whether websocket_recv Provode info whether websocket_recv'ed message is binary or not Jan 27, 2016
@venthur venthur changed the title Provode info whether websocket_recv'ed message is binary or not Provide info whether websocket_recv'ed message is binary or not Jan 27, 2016
@Darvame
Copy link
Contributor

Darvame commented Feb 3, 2016

forward op codes: 0x1 (text) and 0x2 (binary), and doing something with op code 0x0 (continuation)

@methane
Copy link
Contributor

methane commented Feb 3, 2016

text message must be utf-8.
So websocket_recv() can return unicode for text message.

@Darvame
Copy link
Contributor

Darvame commented Feb 3, 2016

@methane he is talking about op codes of websocket frame

@danlg
Copy link

danlg commented Apr 25, 2022

@miguelgrinberg says miguelgrinberg/python-engineio#275 is due to a bug in uwsgi code regarding the improper support of binary data. Do you agree @xrmx @unbit?

@danlg
Copy link

danlg commented May 31, 2022

hello @xrmx @unbit?

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

4 participants