facebookexperimental / moq-go-server

This is an experimental relay (optimized for low latency media transfers) that implements IETF MOQ protocol
MIT License
43 stars 6 forks source link

This code is NO longer manteined, it is superseeded by moxygen

moq-go-server

This is an experimental media MOQ relay (AKA: CDN node) based on MOQT draft-01. It can be used in conjunction with following live encoder and player moq-encoder-player. Both repos allows us create a live streaming platform where we can control latency and quality (and others), so we can test scenarios from ultra low latency live (video call) to high quality (and high scale) live.

Basic block diagram Fig1: Basic block diagram

In the following figure you can see an overview of the relay architecture

Relay architecture overview Fig1: Relay architecture overview

Installation

To install this server in a CentOS linux instance follow the next steps:

sudo yum update -y
sudo yum install git tmux -y
sudo yum install golang -y
sudo yum install -y httpd
sudo systemctl start httpd
sudo systemctl enable httpd
sudo yum install mod_ssl -y
<VirtualHost *:80>
    DocumentRoot "/var/www/html"
    ServerName "yourdomain.com"
    ServerAlias "subdomain.yourdomain.com"
</VirtualHost>

<VirtualHost *:443>
    DocumentRoot "/var/www/html"
    ServerName "yourdomain.com"
    ServerAlias "subdomain.yourdomain.com"

    SSLEngine on
    SSLCertificateFile "/etc/letsencrypt/live/subdomain.yourdomain.com/fullchain.pem"
    SSLCertificateKeyFile "/etc/letsencrypt/live/subdomain.yourdomain.com/privkey.pem"
</VirtualHost>
git clone git@github.com:facebookexperimental/moq-go-server.git
cd moq-go-server/src
go build
cd ..
mkdir certs
sudo cp /etc/letsencrypt/live/subdomain.yourdomain.com/privkey.pem certs/certificate.key
sudo chmod 644 certs/certificate.key
sudo cp /etc/letsencrypt/live/subdomain.yourdomain.com/cert.pem certs/certificate.pem
tmux
cd src
./moq-go-server

See details on how use / set up this system as a live streaming relay in moq-encoder-player testing

Origins

This implementation allows relay to relay communication.

Origns block diagram

The way this works is the follwing:

Example of origin config:

{
  "origins": [
    {
      "friendlyname": "test",
      "guid": "3ea8e44a82784c7ba0c107b78d9dea9a",
      "tracknamespace": "simplechat-relay",
      "authinfo": "my super secret",
        "originaddress" : "https://localhost:4455/moq",
      "origincertpath": "./my-cert.pem"
    }
  ]
}

Testing

It is recommended that you test on a server with valid certificate. To facilitate debugging you can:

Note: Webtransport implementation of QUIC-GO currently does NOT allow localtesting, see open issue

License

moq-go-server is released under the MIT License.