Open Icelk opened 2 years ago
Hey, thanks.
I think it's totally possible, but might result in too many #[cfg(..)]
at certain places I think. As far as I understood it, additional dependencies (like httparse
) is a big deal in your case, so your solution would benefit from a slightly leaner dependency, right?
Precisely. It feels wrong to include unused code, especially whole dependencies. Increases compile time and attack vectors. But I do understand if you'd prefer not to add additional #[cfg()]
attribute. The reduction of dependencies is just a nice-to-have in my case, as I've gated the entire WebSocket feature behind #[cfg()]
.
Got it. If it does not change the code-readability much, I would be totally ok with it :)
Nice! Then I'll send a PR to this repo and to tokio-tungstenite this weekend. Thanks!
@application-developer-DA I've sent the PRs :)
Hey @Icelk , is it currently possible to make a WebSocket instance with skipping the handshake? In my case, I'm also handling the handshake manually, but can't figure out how to use this library without the handshake.
EDIT: Nevermind! I just found tungstenite::protocol::WebSocket::from_raw_socket
Hi. Thanks for the great code!
Is it possible for you to add a cargo feature for the handshake code? I'm handling the handshake manually, so the dependencies pulled in (like
httparse
) are unnecessary.I can make a PR if you'd like. Thanks!