No description
- JavaScript 41.7%
- TypeScript 31.8%
- CSS 14.6%
- HTML 11.7%
- Dockerfile 0.2%
| public | ||
| src | ||
| .env.example | ||
| .gitattributes | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| biome.json | ||
| compose.yml | ||
| Dockerfile | ||
| LICENSE | ||
| logger.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
SRS Viewer
A real-time streaming viewer application for SRS (Simple Realtime Server) with multi-stream support, live viewer tracking, chat, and Discord Activity integration.
Features
- Individual stream viewing with real-time stats
- Multi-stream dashboard with customizable grid layouts (1x2, 2x1, 2x2, 3x2, 3x3, auto)
- WebSocket-based live viewer counting
- HLS and HTTP-FLV streaming support
- On-demand stream transcoding (720p, 480p, 360p)
- Live chat with moderation (bans, slow mode, message deletion)
- User authentication with stream keys
- Stream preview thumbnails
- Stats and analytics dashboard
- Discord Activity integration (embedded app)
- Theatre mode for individual streams
- Privacy policy and Terms of Service pages
Requirements
- Bun runtime
- SRS server instance
- PostgreSQL (if authentication is enabled)
- Redis (if chat is enabled)
Environment Variables
Create a .env file in the root directory. See .env.example for all available options.
Required
| Variable | Description |
|---|---|
HOST |
Bind address (default: 0.0.0.0) |
PORT |
Server port (default: 6600) |
SRS_URL |
URL to your SRS API (e.g. http://srs:1985) |
Stream Previews
| Variable | Description |
|---|---|
PREVIEWS_ENABLED |
Enable stream preview thumbnails (true/false) |
PREVIEW_URL |
Preview URL template with {SRS_URL} and {STREAM_KEY} placeholders |
Authentication
| Variable | Description |
|---|---|
ENABLE_AUTHENTICATION_API |
Enable user auth system (true/false) |
POSTGRES_URL |
PostgreSQL connection string (required if auth enabled) |
JWT_SECRET |
Secret for signing JWT tokens (required if auth enabled) |
JWT_EXPIRES_IN |
Token expiry duration (default: 24h) |
Chat
| Variable | Description |
|---|---|
ENABLE_CHAT |
Enable live chat (true/false, requires auth enabled) |
REDIS_URL |
Redis connection string (required if chat enabled) |
Transcoding
| Variable | Description |
|---|---|
ENABLE_TRANSCODE |
Enable on-demand transcoding (true/false) |
TRANSCODE_QUALITIES |
Comma-separated quality list (default: 720p,480p,360p) |
TRANSCODER_URL |
URL of the transcoder sidecar |
Discord Activity
| Variable | Description |
|---|---|
DISCORD_CLIENT_ID |
Discord application client ID |
DISCORD_CLIENT_SECRET |
Discord application client secret |
Other
| Variable | Description |
|---|---|
TRUST_PROXY |
Trust proxy headers for real IP (true/false) |
NODE_ENV |
Set to development for dev mode |
Development Setup
- Install dependencies:
bun install
- Start development server:
bun run dev
The application will be available at http://localhost:6600
Production
bun run start
Docker
- Build image:
docker build -t srs-viewer .
- Docker Compose:
docker compose up -d
Routes
| Path | Description |
|---|---|
/ |
Main dashboard showing all active streams |
/watch/{stream} |
Individual stream viewer |
/group |
Multi-stream grid viewer |
/stats |
Statistics dashboard |
/analytics |
Analytics dashboard |
/help |
Streaming setup guide |
/chat |
Chat WebSocket endpoint |
/tos |
Terms of Service |
/privacy |
Privacy Policy |
/activity |
Discord Activity entry point |