Hi everybody,
I am running a streaming server at home. The problem is that I have a low bandwidth so only 3 people can actually listen to my radio at the same time. I use a little PHP script that opens a socket to my stream and replicate it on my web server. Basically, I am trying to use my host bandwidth instead of mine since I have a 15Gb/month data transfer contract but I only use about 10 Mb/month…
The script is:
<?php
$streamname = "mydomain"; //the domain where the streaming server is running
$port = "8000"; // the streaming server’s port
$path = "/mystream.mp3"; // extra path to open the stream
header("Content-type: audio/mpeg");
$sock = fsockopen($streamname,$port);
fputs($sock, "GET $path HTTP/1.0\r\n");
fputs($sock, "Host: $streamname\r\n");
fputs($sock, "User-Agent: WinampMPEG/2.8\r\n");
fputs($sock, "Accept: /\r\n");
fputs($sock, "Icy-MetaData:1\r\n");
fputs($sock, "Connection: close\r\n\r\n");
fpassthru($sock);
fclose($sock);
?>
This scripts works fine because listeners now load the stream from my web server and not my streaming server but I have a problem: if 20 persons run this script, my web server will open 20 different sockets to my streaming server which means that the live stream is downloaded 20 times. I would like to create only 1 socket so that the web server only downloads one time the live stream while it redistribute it to all listeners.
I previously created a thread about this topic about 3 months ago but nobody answered me. If it is impossible, could you just tell me: “it is not possible”?
Thanks in advance for any help,
Macsym