This Fastify application serves Web sockets requests.
It is provided for testing Web sockets capabilities on Cloud Run.
You can use the gcloud
SDK:
git clone https://github.com/nearform/fastify-cloud-run.git
cd fastify-cloud-run/ws
gcloud beta run deploy fastify-ws --source=.
You may need to specify additional options to the command based on how your Cloud Shell is configured
Cleanup: Remove the fastify-ws
Service you deployed from Cloud Run
using the Cloud Console.
-
Check out this repository and navigate to this directory
-
Start the server locally:
npm install npm start
-
After the server starts, make a request using
websockat
or another Web socket client.websocat ws://localhost:3000
Note: If you have deployed on Cloud Run, you can replace
localhost:3000
with your Cloud Run service URL and use an online Web socket client like -
The sample Web socket server works as the echo command, type something in the terminal and it should respond with the same:
hello↵ hello world↵ world