Gustavs R
Gustavs R

Reputation: 61

Web radio stream proxying

I have website that allows user to listen to many foreign radio stations. Until this, all stations were streamed using http, directly from radio servers.

I want to run my website with SSL (https), but once I include any radio station stream in http, my SSL "lock" changes color to grey.

Is there any way to proxy radio stream? For example, user makes request to my server (which is running with SSL) and my server streams that radio, so user can stream my server.

I mean - Client ->(streams) My server ->(streams) Radio stream

Is it possible and how? Available languages are PHP, node.js, maybe Python.

Upvotes: 2

Views: 5019

Answers (1)

Alex Paramonov
Alex Paramonov

Reputation: 2730

Yes, you can proxy any Icecast or Shoutcast stream using web server like Nginx or Apache, here is a basic example for both of them:

Nginx

server {
        listen   443;
        server_name radio.com;
        ....
        location /stream { 
           proxy_pass http://stream.anotherradio.com:8000/mount; 
        }
        ....
}

Apache

Activate Apache proxy modules, and update radio.com virtual host configuration configuration:

<VirtualHost *:443>
   ServerName radio.com
   ....
   ProxyPass /stream http://stream.anotherradio.com:8000/mount
</VirtualHost>

Bear in mind, that all network traffic will go through your server and that can cost you money, check you hosting provider traffic limits and conditions.

Upvotes: 5

Related Questions