-
Notifications
You must be signed in to change notification settings - Fork 76
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
Switch websocket library #115
Comments
Sounds good, might be worth doing before the engineio crate goes public? I'm not interested in implementing the change in the near future (only if it causes headache with 0.5.0). |
Alright, I could implement it as soon as refactoring is merged. Also a good point that this should be done before engine.io goes public, then I am not tied to a certain API. |
Doesn't necessary have to be before, but might make sense. Ideally what library we are using internally for websockes/polling would not be exposed anyways. |
websocket is exposed here rust-socketio/engineio/src/error.rs Line 44 in 9b1183b
Plus we'll need the https://docs.rs/tungstenite/0.15.0/tungstenite/fn.client_tls_with_config.html to continue supporting passing in a TlsConnector |
May want to escalate this @1c3t3a websocket (latest) depends on hyper 0.10.6 which is vulnerable to RUSTSEC-2021-0079 and RUSTSEC-2021-0078 (found using cargo-audit) |
This is actually really bad... I've looked into it and the only solution for |
Does it make sense to release a new version of
Have you missed it when you were shopping around for a Websocket library? |
Hi @vi, first of all thanks for the quick help! We originally wanted to switch to tungstenite, but the problem is that the sync version of it is by far slower than websocket.
This is due to sync tungstenite not supporting the When I started the project about a year ago I didn't see the warning on web sockets Readme (I don't know if it wasn't there of if I just missed it), but the API seemed fine and the project was a bit more vivid then now. |
Note that Splitting should work properly for async, including for |
It is more than a year ago: websockets-rs/rust-websocket@b4f50dd |
Then I missed it :D |
Yeah that's true, but it still feels like this is taking away potential speed. But we might change this, @nshaaban-cPacket suggested to internally use async to speed things up, that might now be the best solution. |
Using async internally has it's drawbacks too, we'd have to use a tokio runner (term might be wrong) internally for method calls, which is far from ideal, not to mention also has a performance hit. We may be able to support roughly the same API in asnyc (as most of it is callback based anyways), would require more thought. |
There is also |
This library currently uses the websocket crate. However the library looks kind of abandoned and might not be the best fit for future plans like
async / await
support. Currently the library provides async support based ontokio
0.1. This could lead to problems and there are no real plans to get the support running with websocket (see #242). It's also not to be expected that the library will provide support in case we have a problem, so switching the library might be a good idea. A battle proven implementation is provided bytungstenite-rs
(async here, blocking here). What do you think @nshaaban-cPacket?The text was updated successfully, but these errors were encountered: