Conversation
|
Rather than doing this awkward wrangling with feature flags I think it would be better to implement alternative TLS strategies in another crate as a custom |
|
@alexjg do you mean a crate external to this repo? Also, if you intend to keep |
|
Yeah maybe we should just have another crate for all websocket related things. The reason I am averse to the feature flags is that they don't compose nicely, if I'm reading the docs on the packages in question correctly then you have to only enable one of them and features are additive, so it's easy for both features to get switched on by different parts of the dependency graph and now you have a weird compilation error that's hard to track down because you've gone through three crates worth of feature flags (tungstenite, tokio-tungstenite, samod). Maybe I'm misunderstanding the documentation though and it's fine to enable all of them? |
|
I assumed since we're delegating to the tungstenite features here, that crate would have it's own incompatibility blocking. Let me double check! And yeah, if you don't add the tls feature flags, you don't get any TLS. |
|
Looks like you can enable both flags for tokio-tungestenite but native-tls is given preferrence: https://github.com/snapview/tokio-tungstenite/blob/57fc3d0276564efaf11efe8c1499b26b44dbe9a4/src/tls.rs#L221-L232 I do understand the confusion concern. I just deferred to established ecosystem conventions here as seen in big crates like https://lib.rs/sqlx. |
|
Okay great (and thanks for elaborating) in that case if you could rebase the PR and update the commit to move the note in |
a81e9a7 to
41cd8d5
Compare
Feature flags to configure TLS impl for tokio ws.
Disclaimer
This PR was entirely written by a Codex agent.