I´m trying to get data from a radio stream (MP3) from http and want to stream it out in https. this is what I tried:
For your stream, using PHP's readfile();
is enough. It achieves same result as putting the radio link directly in an <audio>
tag.
PHP code (save as testproxy.php
) :
<?php
$file = "http://mp3channels.webradio.antenne.de/antenne";
readfile($file);
?>
HTML (use the above PHP file as source of some <audio>
tag) :
<!DOCTYPE html>
<html>
<body>
<audio id="audio" controls>
<source crossorigin="anonymous" src="testproxy.php" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</body>
</html>