A high-fidelity RTMP streaming server built with Node.js to act as the engine for a custom web radio station. It allows direct connections from OBS Studio and manages the real-time transmission lifecycle seamlessly.
The project is designed following the MVC (Model-View-Controller) pattern, applying Dependency Injection (DI) and software engineering best practices:
- Config: Centralization of environment variables (
.env). - Models: Management of the internal transmission state (Online/Offline).
- Controllers: Business logic handling network stream events.
- Services: Core RTMP server management (
node-media-server) and notification systems.
Create a .env file in the root directory with the following structure:
RTMP_PORT=1935
STREAM_SECRET_KEY="SECRET KEY"
HTTP_PORT=8000
NODE_ENV=developmentInstall the required modules by running in your terminal:
npm installProduction / Normal Mode:
npm startDevelopment Mode (With auto-refresh via Nodemon):
npm run devIf you are a content creator streaming on this radio station, follow these quick steps to configure your OBS Studio:
Open OBS Studio.
Click on Settings (Ajustes) in the bottom-right corner.
Select the Stream (Emisión) tab from the left menu.
Set Service (Servicio) to Custom... (Personalizado).
Enter the following Server (Servidor) URL:
rtmp://localhost/live
(Note: If you are streaming from a different computer within the house, replace localhost with the host PC's Local IP address, e.g., rtmp://192.168.1.XX/live).
In the Stream Key (Clave de retransmisión) field, paste your designated secret password:
dracogilga
Click Apply (Aplicar) and then OK (Aceptar).
Set up your microphone or background music in OBS.
Click Start Streaming (Iniciar transmisión).
The status square in the bottom-right corner of OBS will turn green, indicating you are successfully live on the web radio!
👨💻 Author: Cesar Gonzalez Lopez (DracoGilga) - dracogilga.com