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

WebSocketStream<TlsStream<TcpStream>> and Framed #260

Closed
hanusek opened this issue Feb 3, 2023 · 1 comment
Closed

WebSocketStream<TlsStream<TcpStream>> and Framed #260

hanusek opened this issue Feb 3, 2023 · 1 comment

Comments

@hanusek
Copy link

hanusek commented Feb 3, 2023

Hello @snapview
I would like to create - Framed<WebSocketStream<TlsStream>, BytesCodec>.

How to use WebSocketStream<TlsStream<TcpStream>> and Framed?

@daniel-abramov
Copy link
Member

daniel-abramov commented Feb 8, 2023

We have an open (albeit old) issue about that: #32

It is not possible to use Framed out-of-the-box, but it's possible to build such support by extracting certain bits out of tungstenite and implementing the Encoder and Decoder traits.

The main reason for this is that Framed does not have a complicated state machine, it's more about encoding/decoding things. Whereas with tungstenite we also manage the state machine that complies with the RFC.

If we were to extract the tungstenite's part of the message parsing in its own tungstenite-core, then building Framed on top of that would be quite trivial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants