Modern Live TV streaming website with:
- Public player (
/) - Hidden admin panel (custom secret path)
- HLS playback via HLS.js
- Bootstrap 5 minimal UI (CDN-based)
- Channel data persisted in
data/channels.json
- HLS
.m3u8playback on modern browsers - Server-side HLS proxy (public client never receives raw
streamUrl) - HLS proxy token reuse + automatic stale segment cleanup
- Safari native HLS fallback
- Responsive dark UI
- Search + category filtering on player
- Channel grid with thumbnails
- Auto-play selected channel
- Buffering spinner overlay
- Realtime live comments (name + message) with per-channel chat rooms
- Dynamic live viewer count tied to active channel room presence
- Hidden admin URL (not shown on public page)
- Admin login/logout
- Advanced admin tools:
- Channel CRUD
- Priority-based ordering
- Move up/down + direct priority set
- Table search and category filter
- Dashboard stats (channels/categories/countries)
- Export channels JSON
LiveTV/
|-- server.js
|-- package.json
|-- .env.example
|-- data/
| `-- channels.json
`-- public/
|-- index.html
|-- admin.html
`-- assets/
`-- js/
|-- app.js
|-- comments.js
`-- admin.js
PORT(default:3000)ADMIN_USERNAME(default:admin)ADMIN_PASSWORD(default:admin123)ADMIN_PATH(default:/control-room)
The app auto-loads .env from the project root at startup.
Example PowerShell:
$env:PORT=3000
$env:ADMIN_USERNAME="admin"
$env:ADMIN_PASSWORD="change_me"
$env:ADMIN_PATH="/my-secret-panel"- Install dependencies:
npm install- Start server:
npm start- Open:
- Player:
http://localhost:3000/ - Admin:
http://localhost:3000<ADMIN_PATH>
Example admin URL if ADMIN_PATH=/my-secret-panel:
http://localhost:3000/my-secret-panel
Note:
/adminand/admin.htmlintentionally return404.
data/channels.json:
{
"id": "unique-id",
"name": "Channel Name",
"category": "News",
"country": "US",
"thumbnail": "https://example.com/logo.jpg",
"streamUrl": "https://example.com/live/index.m3u8",
"priority": 1
}Lower priority appears first in both player and admin list.
Public /api/channels response exposes playbackUrl only.
The original streamUrl is returned only in authenticated admin APIs.
- Upload project files.
- Open Setup Node.js App in cPanel.
- Configure app:
- Startup file:
server.js - Node version: latest LTS
- Run
npm install. - Set env vars (
ADMIN_PASSWORDandADMIN_PATHare important). - Restart the app.
- Upload project:
scp -r LiveTV user@server:/var/www/livetv- Install dependencies:
cd /var/www/livetv
npm install
npm install -g pm2- Start with env vars:
PORT=3000 ADMIN_USERNAME=admin ADMIN_PASSWORD=change_me ADMIN_PATH=/my-secret-panel pm2 start server.js --name livetv
pm2 save- Configure Nginx reverse proxy to
127.0.0.1:3000.
- Change default admin credentials before production.
- Use a non-guessable
ADMIN_PATH. - Some stream providers enforce token/CORS/referer restrictions.