Actix Web
Actix WebSocket Actorless
Learn how websockets can upgrade your web service by providing live update functionality, using Actix Web.
Description
This example shows how to use a WebSocket to show the live status of the Shuttle API on a web page. The app also provides an echo service and notifies when the number of connected users change.
You can clone the example below by running the following (you’ll need shuttle
CLI installed):
Code
Usage
Once you’ve cloned the example, launch it locally using shuttle run
and then go to http://localhost:8000
. You should be able to see a status page and if you go to your Inspect/Chrome Devtools (depending on what browser you’re using), if you go to the Network tab you’ll see that your browser received a HTTP status code of 101.
If you want to explore other frameworks, we have more examples with popular ones like Tower and Warp. You can find them right here.
Be sure to check out the examples repo for many more examples!
Was this page helpful?