Reputation: 31
we're currently providing video/audo feeds via ffserver over "http" i.e. http://127.0.0.1:8000/folder/feed1.mjpg
however, now we need to add the feeds to secure pages over "https" so we need to do something like this https://127.0.0.1:8000/folder/feed1.mjpg
I have searched the web and docs, but didn't find anything in reference to ffserver and https.
Is this possible? if so can anyone point me in the direction of achieving this?
Upvotes: 3
Views: 1055
Reputation: 31
I had the same problem - embedding the ffserver's non-encrypted WEBM stream into HTTPS web site was causing the browser's "mixed content" warning. I solved the problem by using Apache with mod_proxy. I basically followed this tutorial: https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension
In short, I made only these 3 steps:
enable the proxy modules
a2enmod proxy
a2enmod proxy_http
create a new virtual host in Apache listening on port 443 with the following directives:
<VirtualHost *:443>
ServerName livestream.example.com
ProxyPreserveHost On
ProxyPass / http://0.0.0.0:8090/
ProxyPassReverse / http://0.0.0.0:8090/
SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
set up DNS record for livestream.example.com
My ffserver is running on the same server as Apache, with HTTP port 8090, but I'm sure the proxy can be directed to any other IP address.
That way I was able to embed the WEBM video stream as https://livestream.example.com/somevideo.webm and get rid of the mixed content warning.
(tested on Ubuntu 16.04, Apache 2.4.18, ffserver 2.8.11)
Upvotes: 3