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

Implement WebSockets on top of the new streams #178

Merged
merged 9 commits into from
Nov 27, 2021
Merged

Conversation

aantron
Copy link
Owner

@aantron aantron commented Nov 27, 2021

Apart from changing the underlying abstraction, this also:

  • Removes the push-oriented ("read as fast sa possible") WebSocket reader and replaces it with a more pull-oriented reader, to the greatest extent possible with current websocket/af (AFAIK it is not possible to get fully pull-only reading right now). This prevents (or, right now, greatly limits) buffer accumulation in the reader (server), which is a security issue.
  • Exposes the FIN bit, ping and pong frames, and receiving the text/binary message flag to the Dream user (when using the lowest-level stream APIs; high-level convenience APIs don't still hide this). Receiving the text/binary bit is usually not relevant for the server, but may be relevant for some native clients that are not using UTF-8 for whatever reason.

The Dream API is largely unchanged, it is just reimplemented using Stream. The API will be tweaked in follow-on PRs.

@aantron aantron merged commit a339ef9 into master Nov 27, 2021
@aantron aantron mentioned this pull request Nov 27, 2021
6 tasks
@aantron aantron deleted the stream-websocket branch December 1, 2021 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant