mirror of
https://github.com/actix/examples
synced 2024-11-23 14:31:07 +01:00
Add rust client to echo-actorless
- Make it easier for users to find rust code they can use for the client - Remove the need to install websocat to get cli
This commit is contained in:
parent
27be660389
commit
21b6cd1d36
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -8932,10 +8932,12 @@ dependencies = [
|
||||
"actix-files",
|
||||
"actix-web",
|
||||
"actix-ws",
|
||||
"awc",
|
||||
"env_logger",
|
||||
"futures-util",
|
||||
"log",
|
||||
"tokio",
|
||||
"tokio-stream",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3,11 +3,21 @@ name = "websockets-echo-actorless-example"
|
||||
version = "1.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[[bin]]
|
||||
name = "websocket-server"
|
||||
path = "src/main.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "websocket-client"
|
||||
path = "src/client.rs"
|
||||
|
||||
[dependencies]
|
||||
actix-files.workspace = true
|
||||
actix-web.workspace = true
|
||||
actix-ws.workspace = true
|
||||
awc.workspace = true
|
||||
env_logger.workspace = true
|
||||
futures-util.workspace = true
|
||||
futures-util = { workspace = true, features = ["sink"] }
|
||||
log.workspace = true
|
||||
tokio = { workspace = true, features = ["rt", "time", "macros"] }
|
||||
tokio-stream.workspace = true
|
||||
|
@ -8,7 +8,7 @@ Simple echo websocket server using [`actix-ws`].
|
||||
|
||||
```sh
|
||||
cd websockets/echo-actorless
|
||||
cargo run
|
||||
cargo run --bin websocket-server
|
||||
# starting HTTP server at http://localhost:8080
|
||||
```
|
||||
|
||||
@ -16,6 +16,13 @@ cargo run
|
||||
|
||||
Go to <http://localhost:8080> in a browser.
|
||||
|
||||
### rust client
|
||||
|
||||
```sh
|
||||
cd websockets/echo-actorless
|
||||
cargo run --bin websocket-client
|
||||
```
|
||||
|
||||
### CLI Client
|
||||
|
||||
```sh
|
||||
|
Loading…
Reference in New Issue
Block a user