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 cargo-shuttle
installed):
shuttle init --from shuttle-hq/shuttle-examples \
--subfolder actix-web/websocket-actorless
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.
Was this page helpful?