mirror of
https://github.com/actix/actix-website
synced 2025-06-26 23:27:43 +02:00
chore(deps): bump actix-web-actors from 4.3.0 to 4.3.1+deprecated in /examples (#433)
* chore(deps): bump actix-web-actors in /examples Bumps [actix-web-actors](https://github.com/actix/actix-web) from 4.3.0 to 4.3.1+deprecated. - [Release notes](https://github.com/actix/actix-web/releases) - [Changelog](https://github.com/actix/actix-web/blob/master/CHANGES.md) - [Commits](https://github.com/actix/actix-web/compare/web-v4.3.0...web-v4.3.1) --- updated-dependencies: - dependency-name: actix-web-actors dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * docs: update websockets docs to use actix-ws --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
@ -1,22 +1,22 @@
|
||||
---
|
||||
title: Websockets
|
||||
title: WebSockets
|
||||
---
|
||||
|
||||
import CodeBlock from "@site/src/components/code_block";
|
||||
|
||||
# Websockets
|
||||
# WebSockets
|
||||
|
||||
Actix Web supports WebSockets with the `actix-web-actors` crate. It is possible to convert a request's `Payload` to a stream of [_ws::Message_][message] with a [_web::Payload_][payload] and then use stream combinators to handle actual messages, but it is simpler to handle websocket communications with an http actor.
|
||||
Actix Web supports a high-level WebSocket interface via the `actix-ws` crate. Using this crate, it's possible to convert a request's `Payload` stream into a stream of [_ws::Message_][message]s and then react to them inside a spawned async task.
|
||||
|
||||
The following is an example of a simple websocket echo server:
|
||||
The following is an example of a simple WebSocket echo server:
|
||||
|
||||
<CodeBlock example="websockets" file="main.rs" section="websockets" />
|
||||
|
||||
> A simple websocket echo server example is available in the [examples directory][examples].
|
||||
> A simple WebSocket echo server example is available [in the examples repo][echo].
|
||||
|
||||
> An example chat server with the ability to chat over a websocket or TCP connection is available in [websocket-chat directory][chat]
|
||||
> An example chat server is also available [in the examples directory][chat]
|
||||
|
||||
[message]: https://docs.rs/actix-web-actors/2/actix_web_actors/ws/enum.Message.html
|
||||
[message]: https://docs.rs/actix-ws/0.3/actix_ws/enum.Message.html
|
||||
[payload]: https://docs.rs/actix-web/4/actix_web/web/struct.Payload.html
|
||||
[examples]: https://github.com/actix/examples/tree/master/websockets
|
||||
[chat]: https://github.com/actix/examples/tree/master/websockets/chat
|
||||
[echo]: https://github.com/actix/examples/tree/master/websockets/echo-actorless
|
||||
[chat]: https://github.com/actix/examples/tree/master/websockets/chat-actorless
|
||||
|
Reference in New Issue
Block a user