Fly runs the image close to your visitors, keeps WebSockets open and gives you TLS. Save this next to your manifest:
1234567891011121314151617181920212223242526app = "my-socket"primary_region = "ams"
[build] image = "ghcr.io/astrit/slash-socket-server:latest"
[env] SOCKET_DATA_DIR = "/data"
[[mounts]] source = "socket_data" destination = "/data"
[http_service] internal_port = 8080 force_https = true auto_stop_machines = "off" auto_start_machines = true min_machines_running = 1
[[http_service.checks]] grace_period = "10s" interval = "30s" method = "GET" path = "/health" timeout = "5s"123456fly apps create my-socketfly volumes create socket_data --region ams --size 1fly secrets set SOCKET_ADMIN_KEY=$(openssl rand -hex 24)fly deployfly scale count 1fly certs add live.example.com # then add the DNS records it printsauto_stop_machines is off so the socket stays up between visitors — a stopped machine drops every connection. Read the admin key back any time with fly ssh console -C 'printenv SOCKET_ADMIN_KEY'.
Run one instance. A socket's state lives in that process (and its volume), so two replicas would be two separate sockets. One small instance holds thousands of open connections.
Then manage it from your Mac: in Slash Socket open Fields → + Server, enter its address and admin key, and push a manifest (or set SOCKET_MANIFEST). Pages connect to wss://your-domain with the client from https://your-domain/client.js.