2022-07-11 02:44:46 +02:00
|
|
|
# Echo WebSocket (actor-less)
|
|
|
|
|
|
|
|
Simple echo websocket server using [`actix-ws`].
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
### Server
|
|
|
|
|
|
|
|
```sh
|
|
|
|
cd websockets/echo-actorless
|
2024-07-22 02:26:59 +02:00
|
|
|
cargo run --bin websocket-server
|
2022-07-11 02:44:46 +02:00
|
|
|
# starting HTTP server at http://localhost:8080
|
|
|
|
```
|
|
|
|
|
2022-07-11 21:19:20 +02:00
|
|
|
### Browser Client
|
2022-07-11 02:44:46 +02:00
|
|
|
|
2022-07-11 21:19:20 +02:00
|
|
|
Go to <http://localhost:8080> in a browser.
|
2022-07-11 02:44:46 +02:00
|
|
|
|
2024-07-22 02:26:59 +02:00
|
|
|
### rust client
|
|
|
|
|
|
|
|
```sh
|
|
|
|
cd websockets/echo-actorless
|
|
|
|
cargo run --bin websocket-client
|
|
|
|
```
|
|
|
|
|
2022-07-11 02:44:46 +02:00
|
|
|
### CLI Client
|
|
|
|
|
|
|
|
```sh
|
|
|
|
# using `websocat` (https://github.com/vi/websocat)
|
|
|
|
websocat -v --ping-interval=2 ws://127.0.0.1:8080/ws
|
|
|
|
```
|
|
|
|
|
|
|
|
[`actix-ws`]: https://crates.io/crates/actix-ws
|