Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[examples-url]: https://github.com/shellrow/websock/tree/main/websock/examples
[crates-badge]: https://img.shields.io/crates/v/websock.svg
[crates-url]: https://crates.io/crates/websock
[doc-url]: https://docs.rs/websock/latest/websock
[license-badge]: https://img.shields.io/crates/l/websock.svg
[examples-url]: https://github.com/foctal/websock/tree/main/websock/examples

# websock
# websock [![Crates.io][crates-badge]][crates-url] ![License][license-badge]

A minimal WebSocket library for native and WebAssembly.

Expand All @@ -28,4 +31,4 @@ See [examples][examples-url].

### WebAssembly

The `websock-wasm-demo` crate contains a small browser demo that connects to a echo server.
The `websock-wasm-demo` crate contains a small browser demo that connects to an echo server.
6 changes: 6 additions & 0 deletions websock-proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name = "websock-proto"
version.workspace = true
edition.workspace = true
authors.workspace = true
description = "Protocol-level primitives shared across websock transports."
repository = "https://github.com/foctal/websock"
readme = "../README.md"
keywords = ["network", "websocket"]
categories = ["network-programming", "web-programming"]
license = "MIT"

[dependencies]
bytes = { workspace = true }
Expand Down
6 changes: 6 additions & 0 deletions websock-tungstenite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name = "websock-tungstenite"
version.workspace = true
edition.workspace = true
authors.workspace = true
description = "Native transport implementation based on tokio-tungstenite."
repository = "https://github.com/foctal/websock"
readme = "../README.md"
keywords = ["network", "websocket", "native"]
categories = ["network-programming", "web-programming"]
license = "MIT"

[dependencies]
websock-proto = { workspace = true }
Expand Down
5 changes: 1 addition & 4 deletions websock-tungstenite/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
//! Native transport implementation based on Tokio Tungstenite.
//!
//! Use this crate on non-wasm targets. The `stream` feature exposes
//! a `Sink`/`Stream` split API for message-oriented workflows.
//! Native transport implementation based on tokio-tungstenite.

mod builder;
mod connection;
Expand Down
1 change: 1 addition & 0 deletions websock-wasm-demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "websock-wasm-demo"
version.workspace = true
edition.workspace = true
authors.workspace = true
publish = false

[lib]
crate-type = ["cdylib"]
Expand Down
6 changes: 6 additions & 0 deletions websock-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name = "websock-wasm"
version.workspace = true
edition.workspace = true
authors.workspace = true
description = "WebAssembly transport implementation for browser-based WebSockets."
repository = "https://github.com/foctal/websock"
readme = "../README.md"
keywords = ["network", "websocket", "wasm"]
categories = ["network-programming", "web-programming"]
license = "MIT"

[dependencies]
websock-proto = { workspace = true }
Expand Down
3 changes: 0 additions & 3 deletions websock-wasm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
//! WebAssembly transport implementation for browser-based WebSockets.
//!
//! This crate wraps `web_sys::WebSocket` and mirrors the native transport API.
//! Enable the `stream` feature to split a connection into `Sink` and `Stream`.

mod builder;
mod connection;
Expand Down
6 changes: 6 additions & 0 deletions websock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name = "websock"
version.workspace = true
edition.workspace = true
authors.workspace = true
description = "WebSocket library for native and WebAssembly"
repository = "https://github.com/foctal/websock"
readme = "../README.md"
keywords = ["network", "websocket", "native", "wasm"]
categories = ["network-programming", "web-programming"]
license = "MIT"

[dependencies]
websock-proto = { workspace = true }
Expand Down
7 changes: 2 additions & 5 deletions websock/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
//! Cross-platform WebSocket facade for native and WebAssembly targets.
//!
//! This crate re-exports the shared protocol types and the appropriate
//! transport implementation for the current target architecture.
//! WebSocket library for native and WebAssembly targets.
//!
//! ## Features
//! - Native (Tokio Tungstenite) support on non-wasm targets
//! - Native (tokio-tungstenite) support on non-wasm targets
//! - Browser WebSocket support on wasm32 targets

pub use websock_proto::*;
Expand Down