See it in action: https://python-fastapi-websockets.wasmer.app/
This example demonstrates a minimal FastAPI WebSocket echo server with a small Bulma‑styled UI.
Open the page, it connects to a WebSocket, and anything you send is echoed back. The UI shows connection status, a message list with timestamps, and round‑trip time (RTT) for echoes.
- WebSocket endpoint at
/api/wsthat echoes back text messages. - Bulma‑styled UI with:
- Status tag (Connecting / Connected / Disconnected)
- Input and Send button (default text: "Hello Wasmer!")
- Message list that shows timestamps and RTT
- Reconnect button when disconnected
All logic lives in a single file: src/main.py.
- Install
uv - Run
uv sync - Run
make run-wasmer
- Install the Wasmer CLI
- Sign up for a Wasmer account at https://wasmer.io
- Run
wasmer loginto authenticate - Run
make deploy-wasmer