datarhei / restreamer

The Restreamer is a complete streaming server solution for self-hosting. It has a visually appealing user interface and no ongoing license costs. Upload your live stream to YouTube, Twitch, Facebook, Vimeo, or other streaming solutions like Wowza. Receive video data from OBS and publish it with the RTMP and SRT server.
https://docs.datarhei.com/restreamer/
Apache License 2.0
3.78k stars 438 forks source link

Activating iFrame with https on my Website #766

Open terra3110 opened 3 months ago

terra3110 commented 3 months ago

I installed Restreamer on Digital Ocean using a Docker Image. Everything works fairly quickly out-of-the box. When I integrated the iframe on my Website, it did not show a Stream. As my Website use https and the Iframe http, the Browser Block it. When I test it on a http-Page, it is working.

So, I followed the Instructions:

I go into the Export Mode, activate lets Encrypt and restart the System.

Now the following iFrame is generated when I ask in the Publishing Section for it:

But it is not working and when I test, https://MYUR did not respond. I test then Port 8181, but it did not work. Including https://MUYRL:8181/ did not get a connection.

I start Docker with the following Parameters:

docker run --detach --rm --name core --privileged --volume /opt/core/config:/core/config --volume /opt/core/data:/core/data --publish 80:8080 --publish 443:8181 --publish 1935:1935 --publish 1936:1936 --publish 6000:6000/udp datarhei/restreamer:latest

In System -> network HTTP is set to 8080, HTTPS to 8181. Firewall is checked, that is not the reason.

I guess I do something wrong, but I did not figure out what.

Frank

ruthwern commented 2 months ago

I can solve this , if you still need to solve it .

yusoko commented 2 months ago

I can solve this , if you still need to solve it .

@ruthwern please help me too, I have the same problem ) I even created an issue https://github.com/datarhei/restreamer/issues/777

ruthwern commented 2 months ago

Ok, i will help you dont worry, its a 2 min task.

yusoko commented 2 months ago

@ruthwern ok, сould you please provide me with the necessary instructions? I look forward to your guidance. I am ready to provide any needed information. Resolving this issue will help at least two people )

ruthwern commented 2 months ago

please check on this instruction :

sudo apt install apt-transport-https ca-certificates curl software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"

apt-cache policy docker-ce

sudo apt install docker-ce

sudo systemctl status docker

docker run -d --restart=always --name restreamer -v /opt/restreamer/config:/core/config -e CORE_API_AUTH_USERNAME=XXXX -e CORE_API_AUTH_PASSWORD=XXXX -v /opt/restreamer/data:/core/data -p 8080:8080 -p 8181:8181 -p 1935:1935 -p 1936:1936 -p 6000:6000/udp datarhei/restreamer:latest

sudo apt install certbot

sudo certbot certonly --standalone -d youdomain.com --email youremail@gmail.com --agree-tos --non-interactive

NB: now after install ssl, copy and keep certificate and key path to use in nginx config.

sudo apt install nginx

sudo nano /etc/nginx/sites-available/yourdomain.com

NB: replace yourdomain.com and yourdomainextension with your actual domain value

server { listen 80; server_name yourdomain.com;

location / {
    proxy_pass http://localhost:8080;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}

}

server { listen 443 ssl; server_name yourdomain.com;

ssl_certificate /etc/letsencrypt/youdomainextension/youdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/youdomainextension/youdomain.com/fullchain.pem;

location / {
    proxy_pass http://localhost:8080;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}

}

sudo ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl restart nginx

sudo nano /etc/cron.daily/cert-renewal

!/bin/bash

certbot renew --quiet sudo systemctl reload nginx

sudo chmod +x /etc/cron.daily/cert-renewal

Last instruction: please dont open port 8181 in setting of restreamer app where ssl is instructed to install, otherwise it will create conflict with this config. simply follow this steps and enjoy. Also don't forgot to release port 80 and 443 from your server firewall .