Skip to content

enspyrco/tech_world_game_server

Repository files navigation

tech_world_game_server

Using shelf and shelf_web_socket for a serverless websocket server.

Project Notes

Running locally

We can debug with a launch configuration that runs bin/server.dart, eg:

{
  "name": "ws_game_server",
  "request": "launch",
  "type": "dart",
  "program": "bin/server.dart"
},

You can use curl to test connecting (but you won't be able to send any data)

curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: localhost" -H "Origin: http://localhost" -H "Sec-WebSocket-Version: 13" -H "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" http://localhost:8080

Deploying to Cloud Run

Setup Workload Identity Federation for GitHub Actions

Build container image & deploy to Cloud Run in CI