Skip to content

Use a single handler implementation for websocket opened by both the server or a client #944

Answered by davidpdrsn
niconicoj asked this question in Q&A
Discussion options

You must be logged in to vote

Not sure it's possible but you can try making the function generic over a Stream + Sink.

Unfortunately we cannot expose the underlying tokio_tungstenite stream from axum since that makes tokio_tungstenite part of our public API which we don't want.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@niconicoj
Comment options

@davidpdrsn
Comment options

Answer selected by niconicoj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #943 on April 18, 2022 15:26.