diff --git a/Cargo.toml b/Cargo.toml index 030f336..ddef370 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ sha-1 = { version = "0.10.1", optional = true } tokio-tungstenite = { version = "0.20.0", optional = true } #tokio-tungstenite-wasm = { version = "0.2.0", optional = true } -tokio-tungstenite-wasm = { git = "https://github.com/UkoeHB/tokio-tungstenite-wasm", rev = "503cf12", optional = true } +tokio-tungstenite-wasm = { git = "https://github.com/UkoeHB/tokio-tungstenite-wasm", rev = "15e61e4", optional = true } tokio-rustls = { version = "0.24.1", optional = true } tokio-native-tls = { version = "0.3.1", optional = true } diff --git a/examples/chat-client-wasm/src/main.rs b/examples/chat-client-wasm/src/main.rs index 6fb3a8c..4446a02 100644 --- a/examples/chat-client-wasm/src/main.rs +++ b/examples/chat-client-wasm/src/main.rs @@ -28,6 +28,7 @@ impl ezsockets::ClientExt for Client { } } +#[cfg(target_family = "wasm")] #[wasm_bindgen::prelude::wasm_bindgen(main)] async fn main() -> Result<(), wasm_bindgen::JsValue> { // setup tracing @@ -41,7 +42,7 @@ async fn main() -> Result<(), wasm_bindgen::JsValue> { heartbeat_ping_msg_fn: Arc::new(|_t: Duration| RawMessage::Binary("ping".into())), ..Default::default() }); - let (client, mut handle) = ezsockets::connect_with( + let (_client, mut handle) = ezsockets::connect_with( |_client| Client {}, config, ezsockets::ClientConnectorWasm::default(), @@ -54,3 +55,8 @@ async fn main() -> Result<(), wasm_bindgen::JsValue> { Ok(()) } + +#[cfg(not(target_family = "wasm"))] +fn main() { + unreachable!() +}