# Reverb WebSocket Setup

## Required env keys
- BROADCAST_CONNECTION=reverb
- REVERB_APP_ID
- REVERB_APP_KEY
- REVERB_APP_SECRET
- REVERB_HOST
- REVERB_PORT
- REVERB_SCHEME (http or https)

## Supervisor example
```
[program:reverb]
process_name=%(program_name)s
command=php artisan reverb:start --host=0.0.0.0 --port=8080
directory=/var/www/gamegate_backend
autostart=true
autorestart=true
user=www-data
redirect_stderr=true
stdout_logfile=/var/log/reverb.out.log
```

## Nginx WebSocket proxy example
```
location /app {
    proxy_pass http://127.0.0.1:8080;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    proxy_read_timeout 60s;
    proxy_send_timeout 60s;
}
```

## Frontend env keys
- NEXT_PUBLIC_API_BASE_URL
- NEXT_PUBLIC_REVERB_APP_KEY
- NEXT_PUBLIC_REVERB_HOST
- NEXT_PUBLIC_REVERB_PORT
- NEXT_PUBLIC_REVERB_SCHEME

## Notes
- Ensure the Reverb host/port are reachable from the frontend domain.
- If you terminate TLS at Nginx, set NEXT_PUBLIC_REVERB_SCHEME=https and use wss.
