This code is NO longer manteined, it is superseeded by moxygen
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.
Fig1: Basic block diagram
In the following figure you can see an overview of the relay architecture
Fig1: Relay architecture overview
To install this server in a CentOS linux instance follow the next steps:
Create a new user, and add it to sudoers
Configure firewall to allow:
Update server
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
Configure certificates (needed for WebTransport)
Configure Apache
/etc/httpd/conf/httpd.conf
. Locate the "Listen 80" and add the following lines after it, replacing the example domain names.<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>
Configure certificates
Clone this repo
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
This implementation allows relay to relay communication.
The way this works is the follwing:
--moq_origins_config
, example ./origins/example-origins.json
(or see below)tracknamespace
are forwarded to all the relays that offers that tracknamespace (via tracknamespace
in its config){
"origins": [
{
"friendlyname": "test",
"guid": "3ea8e44a82784c7ba0c107b78d9dea9a",
"tracknamespace": "simplechat-relay",
"authinfo": "my super secret",
"originaddress" : "https://localhost:4455/moq",
"origincertpath": "./my-cert.pem"
}
]
}
It is recommended that you test on a server with valid certificate. To facilitate debugging you can:
Install delve
sudo go install github.com/go-delve/delve/cmd/dlv@latest
Build app for debug
cd src
go build -gcflags="all=-N -l"
Run in debug mode in the remove machine
cd src
[GO PATH]/go/bin/dlv --listen=:2345 --headless=true --log=true --accept-multiclient --api-version=2 exec moq-go-server -- --listen_addr ":4455"
Note: The delve listen port needs to be open in that remote machine
Connect VSCode (or other IDE) to that remote machine In this link you can find a good guide
Note: Webtransport implementation of QUIC-GO currently does NOT allow localtesting, see open issue
moq-go-server is released under the MIT License.