Gelbpunkt / tokio-websockets

High performance, strict, tokio-util based websockets implementation
MIT License
62 stars 11 forks source link

compile error #40

Closed AlfredoCubitos closed 9 months ago

AlfredoCubitos commented 9 months ago

Hi,

I'm getting the following error:

error: client and server implementation require at least one SHA1 backend error[E0432]: unresolved import crate::sha::digest

I'm getting this error although all requirements are satisfied (I think) All the modules before websockkets compiled well, there were no errors. Any ideas?

my cargo.toml:

[dependencies]
clap = {version = "4.4", features = ["cargo"]}
serde_json = "1.0.113"
confy = "0.6.0"
serde = {version = "1.0.196", features = ["derive"]}
http = "1.0.0"
futures-util = "0.3.30"
tokio = {version = "1.36.0", features = ["full"]}
tokio-util = "0.7.10"
openssl = { version = "0.10", features = ["vendored"] }
tokio-boring-imp = "2.1.5"
sha1_smol = "1.0.0"
fastrand = "2.0.1"
tokio-websockets = {version = "0.5.1", features = ["native-tls","client"]}
vilgotf commented 9 months ago

Whilst it's recommended to combine the OpenSSL SHA1 backend and the native-tls features on Linux (as OpenSSL is used as the TLS backend on Linux when enabling the native-tls feature), it's not required. In your case, try appending openssl to the features list.

AlfredoCubitos commented 9 months ago

thank you, this works fine. The sha1 error disappeared with the openssl feature :-)

But there are two remaining errors:

error: Using the `client` feature requires enabling a random number generator implementation via one of the following features: `fastrand`, `getrandom` or `rand`.

and

unresolved import `imp`

pub use imp::{get_key, get_mask};
   |         ^^^ use of undeclared crate or module `imp`

Any idea to solve this?

vilgotf commented 9 months ago

Read the error message again. The second error stems from the first one

AlfredoCubitos commented 9 months ago

I red this. As you can see in my toml I configured fastrand and it compiled fine. So I'm wondering why this error appears?

vilgotf commented 9 months ago

You need to add the fastrand feature to tokio-websockets, not add fastrand as a dependency.

AlfredoCubitos commented 9 months ago

ok, thank you! :-)