gbaranski/ezsockets
์๊ฐ
High-level declarative API for building WebSocket Clients and Servers in Rust ๐ฆ
์น ๋ฐ ์ฑ ๊ฐ๋ฐ์ธก์ ๋ ์คํ ์ฆ๊ฐ
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- +2
- in 1 month
- ๊ธฐ๋ก ์์ง ์ค
์๋ก ๊ฒน์น๋ ๊ธฐ๊ฐ์ ์์ฆ๊ฐ๋์ด๋ฉฐ ์ผ๋ณ ํฉ๊ณ๊ฐ ์๋๋๋ค. ์ธก์ ๊ฐ์ด ์์ผ๋ฉด ๋น์ ๋ก๋๋ค. ์คํ๋ ๊ด์ฌ๋๋ฅผ ๋ํ๋ด๋ฉฐ ํ์ง์ ๋ณด์ฅํ์ง ์์ต๋๋ค.
README.md
Originalezsockets
Creating a WebSocket server or a client in Rust can be troublesome. This crate facilitates this process by providing:
- Traits to allow declarative and event-based programming.
- Easy concurrency with Tokio and async/await. Server sessions are Clone'able and can be shared between tasks.
- Heartbeat mechanism to keep the connection alive.
- Automatic reconnection of WebSocket Clients.
- Support for arbitrary client back-ends, with built-in native and WASM client connectors.
- Support for multiple server back-ends such as Axum or Tungstenite.
- TLS support for servers with
rustlsandnative-tls.
Documentation
View the full documentation at docs.rs/ezsockets
Examples
simple-client- a simplest WebSocket client which uses stdin as input.echo-server- server that echoes back every message it receives.echo-server- same asecho-server, but withnative-tls.counter-server- server that increments global value every second and shares it with clientchat-client- chat client forchat-serverandchat-server-axumexampleswasm-client- chat client forchat-serverandchat-server-axumexamples that runs in the browser (only listens to the chat)chat-server- chat server with support of roomschat-server-axum- same as above, but usingaxumas a back-end
Client
By default clients use tokio-tungstenite under the hood. Disable default features and enable wasm_client to run clients on WASM targets.
See examples/simple-client for a simple usage and docs.rs/ezsockets/server for documentation.
Server
WebSocket server can use one of the supported back-ends:
tokio-tungstenite- the simplest way to get started.axum- ergonomic and modular web framework built with Tokio, Tower, and Hyperactix-web- Work in progress at #22
See examples/echo-server for a simple usage and docs.rs/ezsockets/server for documentation.
License
Licensed under MIT.
Contact
Reach me out on Discord gbaranski#5119, or mail me at [email protected].
๊ด๋ จ ํ๋ก์ ํธ ์ดํด๋ณด๊ธฐ
๋ถ๋ฌ์ค๋ ์คโฆ