Skip to content

Commit

Permalink
feat: add support WSS
Browse files Browse the repository at this point in the history
  • Loading branch information
c-git committed Dec 30, 2024
1 parent 636d391 commit c153522
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,7 @@ dependencies = [
"env_logger",
"ewebsock",
"log",
"rustls",
"tokio",
"wasm-bindgen-futures",
"web-sys",
Expand Down Expand Up @@ -2522,11 +2523,12 @@ dependencies = [

[[package]]
name = "rustls"
version = "0.23.7"
version = "0.23.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebbbdb961df0ad3f2652da8f3fdc4b36122f568f968f45ad3316f26c025c677b"
checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b"
dependencies = [
"once_cell",
"ring",
"rustls-pki-types",
"rustls-webpki",
"subtle",
Expand All @@ -2535,15 +2537,15 @@ dependencies = [

[[package]]
name = "rustls-pki-types"
version = "1.3.0"
version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "048a63e5b3ac996d78d402940b5fa47973d2d080c6c6fffa1d0f19c4445310b7"
checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37"

[[package]]
name = "rustls-webpki"
version = "0.102.2"
version = "0.102.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610"
checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9"
dependencies = [
"ring",
"rustls-pki-types",
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ tungstenite = ">=0.23, <=0.24"
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = "0.3"
rustls = { version = "0.23.20", default-features = false }


[workspace.lints.rust]
Expand Down
1 change: 1 addition & 0 deletions example_app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ env_logger.workspace = true

# native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
rustls = { workspace = true, features = ["ring"] }
tokio = { workspace = true, optional = true, features = [
"macros",
"rt-multi-thread",
Expand Down
6 changes: 6 additions & 0 deletions example_app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ fn main() -> eframe::Result<()> {
fn main_impl() -> Result<(), eframe::Error> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).

// Setup a CryptoProvider to be able to use wss
match rustls::crypto::ring::default_provider().install_default() {
Ok(()) => {} // Do nothing crypto provider install successful
Err(_) => log::warn!("failed to install CryptoProvider"),
}

let app = example_app::ExampleApp::default();
let native_options = eframe::NativeOptions::default();
eframe::run_native(
Expand Down

0 comments on commit c153522

Please sign in to comment.