3

我们目前正在通过“http”上的 ffserver 提供视频/音频提要,即http://127.0.0.1:8000/folder/feed1.mjpg

但是,现在我们需要通过“https”将提要添加到安全页面,所以我们需要做这样的事情https://127.0.0.1:8000/folder/feed1.mjpg

我搜索了网络和文档,但没有找到任何关于 ffserver 和 https 的内容。
这可能吗?如果是这样,任何人都可以指出我实现这一目标的方向吗?

4

1 回答 1

2

我遇到了同样的问题 - 将 ffserver 的未加密 WEBM 流嵌入 HTTPS 网站会导致浏览器的“混合内容”警告。我通过使用带有 mod_proxy 的 Apache 解决了这个问题。我基本上遵循了本教程:https ://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension

简而言之,我只做了这 3 个步骤:

  1. 启用代理模块

    a2enmod proxy
    a2enmod proxy_http
    
  2. 使用以下指令在 Apache 中创建一个新的虚拟主机,监听端口 443:

    <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>
    
  3. 设置 DNS 记录livestream.example.com

我的 ffserver 与 Apache 在同一台服务器上运行,HTTP 端口为 8090,但我确信代理可以定向到任何其他 IP 地址。

这样我就能够将 WEBM 视频流嵌入为https://livestream.example.com/somevideo.webm并摆脱混合内容警告。

(在 Ubuntu 16.04、Apache 2.4.18、ffserver 2.8.11 上测试)

于 2017-11-13T04:58:43.243 回答