网络广播流代理

Gus*_*s R 2 php python ssl proxy stream

我有一个网站,允许用户收听许多外国广播电台。在此之前,所有电台都直接从无线电服务器使用 http 进行流式传输。

我想使用 SSL (https) 运行我的网站,但是一旦我在 http 中包含任何广播电台流,我的 SSL“锁定”就会将颜色更改为灰色。

有没有办法代理无线电流?例如,用户向我的服务器(使用 SSL 运行)发出请求,我的服务器流式传输该无线电,因此用户可以流式传输我的服务器。

我的意思是 - 客户端 ->(流)我的服务器 ->(流)无线电流

有可能吗?可用的语言是 PHP、node.js,也许是 Python。

Ale*_*nov 5

是的,您可以使用 Nginx 或 Apache 等网络服务器代理任何 Icecast 或 Shoutcast 流,以下是它们的基本示例:

nginx

server {
        listen   443;
        server_name radio.com;
        ....
        location /stream { 
           proxy_pass http://stream.anotherradio.com:8000/mount; 
        }
        ....
}
Run Code Online (Sandbox Code Playgroud)

阿帕奇

激活 Apache 代理模块,并更新 radio.com 虚拟主机配置配置:

<VirtualHost *:443>
   ServerName radio.com
   ....
   ProxyPass /stream http://stream.anotherradio.com:8000/mount
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

请记住,所有网络流量都将通过您的服务器,这可能会花费您金钱,请检查您的托管服务提供商流量限制和条件。