mediasoup-cluster
v4.1.1
Published
Mediasoup cluster
Downloads
2
Readme
Mediasoup cluster
Cluster uses PostgreSQL server to save data of slave servers
+----------------+
+-----------------+ webrtc | slave server |
| producer client |------------------------------->| for producer |
+-----------------+ +----------------+
| ^ |
| +---------------+ | |
+--------------->| |------------+ | mediasoup
http | master server | http | pipe
+--------------->| |------------+ | transport
| +---------------+ | |
| v v
| +----------------+
+-----------------+ | slave server |
| consumer client |<-------------------------------| for consumer |
+-----------------+ webrtc +----------------+
Quickstart
Build code (must use node v18+)
npm install
npm run build
Copy env.dev file to .env
cp .env.dev .env
Update config in .env file. Detail in example
// your PostgreSQL server info
DATABASE_URL = "postgresql://postgres:123456@localhost:5432/mediasoup"
...
// your ip in internet network
// https://mediasoup.org/documentation/v3/mediasoup/api/#TransportListenIp
MEDIASOUP_WEBRTC_TRANSPORT_LISTEN_IPS = '[
{
"ip": "192.168.6.143",
"announcedIp": null
}
]'
Create a master server
npm run start:master
Create a slave server to produce
npm run start:slave:producer
Create a slave server to consume
npm run start:slave:consumer
Run demo app
cd examples/rooms/
npm install
npm run dev
Then, navigate to https://localhost:4430
Documentation
Master server API
License
mediasoup-cluster is MIT Licensed.