Install Media server with Mediasoup

Mediasoup is a media server used to send flow between participant.

cat > /etc/apt/sources.list.d/mediasoup.list << EOF
deb [trusted=yes] https://projects.iabsis.com/repository/mediasoup-api/debian bullseye main
EOF

Refresh the list of available package.

apt update

Now install the package

apt install mediasoup-api

Now adjust the file /etc/mediasoup-api/mediasoup-api.conf, don't forgot to define the following lines with your coturn configuration previously defined.

TURN_SERVER1=turn:turn.example.com/?transport=udp
TURN_USERNAME1=myuser
TURN_PASSWORD1=mypwd

Most values are self explanatory, once you done your changes, restart the service with the following command.

systemctl status mediasoup-api

If you prefer want to serve Mediasoup API with Nginx (recommanded), you can create a new Nginx file (by example /etc/nginx/sites-enabled/mediasoup.conf) and use the following template.

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {
    server_name <domain>;

    location / {
        proxy_set_header Host $host;
        proxy_pass https://localhost:3443;
        proxy_set_header X-Forwarded-For $remote_addr;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;

        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Port $server_port;

        proxy_connect_timeout 120m;
        proxy_send_timeout 120m;
        proxy_read_timeout 120m;
    }

    listen 80;
}

Don't forget to update the <domain> part. If you need to issue certbot certificate, use again the following command.

certbot --nginx
Rating
0 0

There are no comments for now.

to be the first to leave a comment.