Rust-powered WebSocket server with Pusher protocol. Public, private & presence channels. Clustering
3.3K
A high-performance, Pusher-compatible WebSocket server written in Rust. Soketi.rs provides real-time messaging capabilities with support for public, private, and presence channels.
# Pull and run the latest image
docker pull funal/soketi-rs:latest
# Run with default configuration
docker run -d \
--name soketi \
-p 6001:6001 \
-p 9601:9601 \
funal/soketi-rs:latest
# Run with custom configuration
docker run -d \
--name soketi \
-p 6001:6001 \
-p 9601:9601 \
-v $(pwd)/config.json:/app/config.json \
funal/soketi-rs:latest
# Server configuration
SOKETI_HOST=0.0.0.0
SOKETI_PORT=6001
SOKETI_DEBUG=false
# App configuration
APP_ID=your-app-id
APP_KEY=your-app-key
APP_SECRET=your-app-secret
# Redis (for clustering)
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0
# Metrics
METRICS_ENABLED=true
METRICS_PORT=9601
version: '3.8'
services:
soketi:
image: funal/soketi-rs:latest
ports:
- "6001:6001"
- "9601:9601"
environment:
- SOKETI_HOST=0.0.0.0
- SOKETI_PORT=6001
- APP_ID=app-id
- APP_KEY=app-key
- APP_SECRET=app-secret
volumes:
- ./config.json:/app/config.json
restart: unless-stopped
redis:
image: redis:alpine
ports:
- "6379:6379"
restart: unless-stopped
Create a config.json file:
{
"host": "0.0.0.0",
"port": 6001,
"debug": false,
"app_manager": {
"driver": "Array",
"array": {
"apps": [
{
"id": "app-id",
"key": "app-key",
"secret": "app-secret",
"enabled": true,
"enable_client_messages": true,
"max_connections": 10000
}
]
}
}
}
// Initialize Pusher client
const pusher = new Pusher('app-key', {
wsHost: 'localhost',
wsPort: 6001,
forceTLS: false,
encrypted: false
});
// Subscribe to a channel
const channel = pusher.subscribe('chat-room');
// Listen for messages
channel.bind('new-message', (data) => {
console.log('New message:', data.message);
});
version: '3.8'
services:
soketi:
image: funal/soketi-rs:latest
ports:
- "6001:6001"
- "9601:9601"
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
volumes:
- ./config.production.json:/app/config.json
depends_on:
- redis
deploy:
replicas: 3
restart: unless-stopped
redis:
image: redis:alpine
restart: unless-stopped
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
depends_on:
- soketi
restart: unless-stopped
# Scale soketi instances
docker-compose up -d --scale soketi=3
# View service status
docker-compose ps
# Check if server is running
curl http://localhost:6001/
# Check metrics
curl http://localhost:9601/metrics
linux/amd64linux/arm64Compatible with all Pusher client libraries:
This project is licensed under the GPL-3.0 License - see the LICENSEβ file for details.
Made with β€οΈ by Ferdi ΓNALβ
Content type
Image
Digest
sha256:ffc6ad090β¦
Size
12.7 MB
Last updated
2 months ago
docker pull funal/soketi-rs