Skip to content

Instantly share code, notes, and snippets.

@PhiloNL
Last active August 7, 2024 20:19
Show Gist options
  • Save PhiloNL/32e2b4ca76778974f590caeff13f2d4e to your computer and use it in GitHub Desktop.
Save PhiloNL/32e2b4ca76778974f590caeff13f2d4e to your computer and use it in GitHub Desktop.
Simple, fast, and resilient open-source WebSockets server using Soketi with SSL in less than 5 minutes
PUSHER_HOST=socket.yourdomain.com
PUSHER_APP_ID=unlock
PUSHER_APP_KEY=123
PUSHER_APP_SECRET=456
PUSHER_PORT=443
PUSHER_SCHEME=https
<?php
return [
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'host' => env('PUSHER_HOST', '127.0.0.1'),
'port' => env('PUSHER_PORT', 6001),
'scheme' => env('PUSHER_SCHEME', 'http'),
'encrypted' => true,
'useTLS' => env('PUSHER_SCHEME') === 'https',
],
],
],
];
socket.yourdomain.com:443 {
reverse_proxy soketi:6001
}
version: '3.3'
services:
soketi:
image: 'quay.io/soketi/soketi:latest-16-alpine'
restart: unless-stopped
ports:
- '6001:6001'
environment:
DEBUG: '0'
DEFAULT_APP_ID: 'unlock'
DEFAULT_APP_KEY: '123'
DEFAULT_APP_SECRET: '456'
caddy:
image: caddy:2.4.6-alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- /home/ec2-user/caddy/Caddyfile:/etc/caddy/Caddyfile
- /home/ec2-user/caddy/data:/data
- /home/ec2-user/caddy/config:/config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment