Configuration
Server settings, SSL certificates, and optimization for LegacyStream
Basic Settings
Configure the fundamental server parameters in the [Server]
section of your configuration file.
Server Configuration
[Server]
# Network ports
HttpPort=8000
HttpsPort=8443
# Connection limits
MaxConnections=100000
MaxStreams=1000
# Performance settings
DefaultLatency=5
BufferSize=65536
# Server information
Location=My Radio Station
Hostname=stream.mystation.com
# Authentication
SourcePassword=source123
RelayPassword=relay456
AdminUsername=admin
AdminPassword=admin123
Parameter Descriptions
Parameter | Default | Description |
---|---|---|
HttpPort |
8000 | HTTP port for streaming and web interface |
HttpsPort |
8443 | HTTPS port for secure streaming |
MaxConnections |
100000 | Maximum concurrent connections |
MaxStreams |
1000 | Maximum number of active streams |
DefaultLatency |
5 | Default stream latency in seconds (1-60) |
BufferSize |
65536 | Audio buffer size in bytes |
SSL Configuration
Configure SSL/TLS certificates for secure streaming and HTTPS access.
SSL Settings
[SSL]
# Enable SSL/TLS
Enabled=true
AutoRenew=true
# Let's Encrypt settings
LetsEncryptEmail=admin@example.com
LetsEncryptDomains=stream.example.com,radio.example.com
# Manual certificate paths
CertificatePath=certs/certificate.crt
PrivateKeyPath=certs/private.key
CertificatePassword=
# Cloudflare integration
CloudflareApiToken=your_api_token
CloudflareZoneId=your_zone_id
Certificate Types
1. Let's Encrypt (Recommended)
Automatic certificate generation and renewal:
- Free certificates
- Automatic renewal
- Domain validation required
- 90-day validity period
2. Manual Certificates
Upload your own certificates:
- Any certificate authority
- Custom validity periods
- Wildcard certificates supported
- Manual renewal required
3. Cloudflare Integration
Use Cloudflare for DNS challenges:
- Automatic DNS validation
- No port forwarding required
- Works behind firewalls
- Requires Cloudflare account
🔒 Security Best Practices
- Use strong passwords for private keys
- Keep certificates in secure locations
- Enable automatic renewal for Let's Encrypt
- Monitor certificate expiration dates
Stream Settings
Configure mount points and stream-specific parameters.
Mount Point Configuration
[MountPoints]
/live=icecast
/classic=shoutcast
/backup=icecast
[MountPoint:/live]
Name=Live Stream
Description=Main live broadcast
Codec=mp3
Bitrate=128
Quality=high
Public=true
MaxListeners=1000
FallbackFile=fallback.mp3
[MountPoint:/classic]
Name=Classic Hits
Description=Classic music stream
Codec=aac
Bitrate=64
Quality=medium
Public=true
MaxListeners=500
Supported Codecs
Codec | Extension | Quality | Bitrate Range |
---|---|---|---|
MP3 | .mp3 | Good | 32-320 kbps |
AAC | .aac | Excellent | 32-256 kbps |
AAC+ | .aac | Very Good | 16-128 kbps |
Ogg Vorbis | .ogg | Excellent | 32-500 kbps |
Opus | .opus | Excellent | 6-510 kbps |
FLAC | .flac | Lossless | Variable |
Web Interface Configuration
Customize the web interface behavior and appearance.
Web Interface Settings
[WebInterface]
# Enable web interface
Enabled=true
# Update intervals
UpdateInterval=1000
EnableRealTimeUpdates=true
# Player settings
EnablePlayerEmbed=true
PlayerTheme=dark
# Mobile settings
EnableMobileResponsive=true
MobileOptimization=true
# Analytics
EnableAnalyticsDashboard=true
AnalyticsUpdateInterval=5000
# Interactive controls
EnableInteractiveControls=true
ControlPassword=admin123
Available Themes
- dark - Dark theme (default)
- light - Light theme
- auto - Follows system preference
📱 Mobile Optimization
The web interface automatically adapts to mobile devices with touch-friendly controls and responsive design.
Performance Tuning
Optimize LegacyStream for your specific use case and hardware.
Performance Settings
[Performance]
# Thread configuration
IOThreads=4
WorkerThreads=8
MaxThreads=16
# Memory management
MemoryPoolSize=1048576
BufferPoolSize=524288
CacheSize=268435456
# Network optimization
TCPKeepAlive=true
TCPNoDelay=true
SocketBufferSize=65536
# Compression settings
EnableCompression=true
CompressionLevel=6
CompressionThreshold=1024
Performance Profiles
Low Latency Profile
For live broadcasting with minimal delay:
DefaultLatency=1
BufferSize=32768
TCPNoDelay=true
CompressionLevel=1
High Capacity Profile
For maximum concurrent listeners:
MaxConnections=1000000
IOThreads=8
WorkerThreads=16
MemoryPoolSize=2097152
Quality Profile
For high-quality audio streaming:
BufferSize=131072
CompressionLevel=9
CacheSize=536870912
DefaultLatency=10
Statistic Relay Configuration
Configure relay settings for external Shoutcast and Icecast servers.
Statistic Relay Settings
[StatisticRelay]
# Enable statistic relay
Enabled=true
UpdateInterval=30
MaxRelays=50
# Shoutcast relay
[ShoutcastRelay]
Name=my_shoutcast_relay
Host=shoutcast.example.com
Port=8000
Password=admin
SID=1
MountPoint=/live
Enabled=true
# Icecast relay
[IcecastRelay]
Name=my_icecast_relay
Host=icecast.example.com
Port=8000
Username=admin
Password=admin
Alias=/live
MountPoint=/live
Enabled=true
Relay Parameters
Parameter | Required | Description |
---|---|---|
Name |
Yes | Unique identifier for the relay |
Host |
Yes | Target server hostname or IP |
Port |
Yes | Target server port |
Password |
Shoutcast | Shoutcast admin password |
Username |
Icecast | Icecast admin username |
Alias |
Icecast | Icecast mount point alias |
Advanced Options
Advanced configuration options for power users.
Logging Configuration
[Logging]
# Log levels: DEBUG, INFO, WARN, ERROR
Level=INFO
LogToFile=true
LogFilePath=logs/legacystream.log
MaxLogSize=10485760
LogRotation=7
# Performance logging
LogPerformance=true
PerformanceLogInterval=60
Security Settings
[Security]
# Access control
RequireAuthentication=false
AllowedIPs=0.0.0.0/0
BlockedIPs=
# Rate limiting
EnableRateLimiting=true
MaxRequestsPerMinute=1000
MaxConnectionsPerIP=100
# DDoS protection
EnableDDoSProtection=true
ConnectionTimeout=30
RequestTimeout=60
Monitoring and Alerts
[Monitoring]
# System monitoring
EnableSystemMonitoring=true
CPUThreshold=80
MemoryThreshold=85
DiskThreshold=90
# Alert settings
EnableAlerts=true
AlertEmail=admin@example.com
AlertWebhook=https://hooks.slack.com/your-webhook
# Health checks
HealthCheckInterval=30
HealthCheckTimeout=10
⚠️ Advanced Configuration Warning
Advanced settings can significantly impact performance and security. Test thoroughly in a development environment before applying to production.