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

Allow binary-only formats (e.g., CBOR) with websockets #847

Merged
merged 2 commits into from
Jan 9, 2020

Conversation

ctm
Copy link
Contributor

@ctm ctm commented Jan 6, 2020

Fixes: #389

This allows the various formats that can't be converted in or out of Text to be used in the callback that a websocket will use.

This allows the various formats that can't be converted in or out of
Text to be used in the callback that a websocket will use.  It also
supports the packed version of CBOR.
@jstarry
Copy link
Member

jstarry commented Jan 7, 2020

Thanks @ctm! I think I would prefer to solve the root issue though. WebSocket should allow binary only formats as well as binary + text formats. Would you be interested in tackling that? It would require some api changes to websocket

Your CBORPacked changes look fine, could you please update (and rebase to fix ci) this PR to only have those changes and then move websocket changes to a follow up PR?

@ctm
Copy link
Contributor Author

ctm commented Jan 7, 2020

@jstarry I'll go ahead and get a CborPacked only PR done this evening and then look into a binary only WebSocket. I'm pretty new to WebSockets, but I'll see if I can pull together a solution to the root issue tomorrow.

@ctm
Copy link
Contributor Author

ctm commented Jan 7, 2020

Closing per above. My CborPacked PR is #849

@ctm ctm closed this Jan 7, 2020
@jstarry jstarry reopened this Jan 9, 2020
@jstarry
Copy link
Member

jstarry commented Jan 9, 2020

@ctm on second thought I think this approach is better. It has the same behaviour as #851 (silently discarding ws messages which can't be deserialized to the specified format) without bloating the api.

@jstarry jstarry changed the title Allow binary-only formats (e.g., CBOR) with websockets (#389) Allow binary-only formats (e.g., CBOR) with websockets Jan 9, 2020
@jstarry jstarry merged commit ba66c3e into yewstack:master Jan 9, 2020
llebout pushed a commit to llebout/yew that referenced this pull request Jan 20, 2020
…yewstack#847)

This allows the various formats that can't be converted in or out of
Text to be used in the callback that a websocket will use.  It also
supports the packed version of CBOR.

Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
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

Successfully merging this pull request may close these issues.

Trouble deserialising CBOR from a websocket message
2 participants