apache - PHP - MP3 proxy for streaming -
i working on mp3 streaming web application. using external api mp3 url, problem mp3's bounded ip requesting file (in case server) , can streamed/downloaded server, other ip result in 404.
what looking best option server act relay/proxy between mp3 , user wanting listen it.
this somehow problem bandwidth, see no alternative.
this code using, broadcasts @ same time downloads, web app can't mp3 tags , somehow broke web app player.
if (isset($_get['name']) , isset($_get['url'])){ $url = urldecode($_get['url']); if ((strpos($url,'xxxxxx') !== false) || (strpos($url,'xxxxxx') !== false)) { header('content-type: application/octet-stream'); header('content-disposition: attachment; filename="' . $_get['name'] . ' - xxxxxx.mp3"'); readfile(urldecode($_get['url'])); } else { header("http/1.0 404 not found"); } } else { header("http/1.0 404 not found"); }
you need use audio stream wrapper. example ogg. it's set same way message socket server set up. if have never made message socket server, recommend watching youtube video on how set message server sockets first.
sorry question isn't straight answer question. not without first knowing know streaming data.
http://php.net/manual/en/wrappers.audio.php
https://www.youtube.com/watch?v=xkbaba5q6dc&list=plgiqzl4bejtoijolwtrf2tehlkx1r-s5a
Comments
Post a Comment