Is it possible to restream an internet radio using PHP?
Radio is available at port 8000. I would like to use my webserver and “transmit” the radio stream to port 80.
Is it possible?
I have already been googling it around and I found http://support.spacialnet.com/forums/viewtopic.php?f=13&t=16858&start=15 but it doesn’t work for me. It does actually work. Before I just forget to change MIME type of the stream.
I customized solution from previously mentioned URL (http://support.spacialnet.com/forums/viewtopic.php?f=13&t=16858&start=15). It does work now, but the stream always breaks after in about 8 minutes of listening. Any clue why?
(server max. execution time is set to 30 seconds). I tested different streams with various bitrates, but it behaves exactly same every time. Any help?
I probably shouldn’t be answering this question, but I had some free time at work and wanted to play with sockets a bit.
Here is my class, it isn’t well-tested(well, it worked on the first run which is suspicious) and may be buggy, but it may give you some usefull ideas. It strips ICY* headers as that example you posted, but that can be easily changed.
I tested it on Ubuntu Totem player and it played well for 10 minutes before I stopped it, but maybe I just got lucky (: At least 8 minutes seems not to be some magical number.
P.S. Don’t do this.