Skip to content
Damián Silvani edited this page Dec 9, 2020 · 2 revisions

Deploy

Configure Muxy server

Copy service files for gunicorn:

sudo cp tools/systemd/muxy-gunicorn.s* /etc/systemd/system/

Edit /etc/systemd/system/muxy-gunicorn.service to replace path to muxy on ExecStart, and correctly set User and Group.

Start and enable service for gunicorn:

sudo systemctl start muxy-gunicorn
sudo systemctl enable muxy-gunicorn

Check if service is running correctly with:

sudo systemctl status muxy-gunicorn

Copy nginx site config:

sudo cp tools/nginx/muxy.example.com /etc/nginx/sites-available/

Rename file to correct server name and edit file to fix server name.

Then, enable site config on Nginx:

sudo ln -s /etc/nginx/sites-available/muxy.example.com /etc/nginx/sites-enabled/

Check for syntax errors on config before restarting nginx:

sudo nginx -t

If everything went OK, restart Nginx:

sudo systemctl restart nginx

Configure nginx-rtmp to set validation

The following is an nginx-rtmp sample configuration, that configures an RTMP application to use Muxy allow/deny mechanism. Remember to replace muxy.example.com with your Muxy hostname.

rtmp {
    application live {
        ...

        notify_update_timeout 10s;

        # HTTP callback when a stream starts publishing.
        # Returns 2xx only if publisher is allowed to publish now.
        on_publish http://muxy.example.com/rtmp/on-publish/;

        # Called when a stream stops publishing.  Response is ignored.
        on_publish_done http://muxy.example.com/rtmp/on-publish-done/;

        # Called with a period of notify_update_timeout,
        # to force disconnect publisher when her allotted time ends.
        on_update http://muxy.example.com/rtmp/on-update/;
    }
}
Clone this wiki locally