-
Notifications
You must be signed in to change notification settings - Fork 169
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
Add Websockets support #1330
Add Websockets support #1330
Conversation
4713596
to
5412416
Compare
pub(crate) struct WebSocketAdapter<T> { | ||
#[pin] | ||
pub(crate) inner: WebSocketStream<T>, | ||
pub(crate) read_buf: BytesMut, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it needs its own buffer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WS libraries returns whole WebSockets messages. Those can be way bigger than the ReadBuf
. Is there a way to avoid that buffer easily? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, had to read the docs, it's a Stream, not a "Stream".
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
ed87c7e
to
81d3207
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
This is a first pass on Websockets support.
features:
what's missing:
next steps:
tokio_websockets
or add ability to choose betweentokio-websockets
andtokio-tungsteninte
/fastwebsockets
.Signed-off-by: Tomasz Pietrek tomasz@nats.io