K
K
Kirill Petrov2018-02-21 15:50:40
PHP
Kirill Petrov, 2018-02-21 15:50:40

How to proxy streaming MP3 audio in PHP?

Greetings. There are links to mp3 streams closed by authorization (freeswitch PBX has a web api to eavesdrop on conversations). The task is to make a proxy in PHP or something else, which will be authorized

// (авторизация самая простая)
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");

And download mp3 in real time and send it to the browser without delays (with minimal delays) to the tag in the browser...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ivankomolin, 2018-02-27
@ivankomolin

Php is a bad tool for this task. Dig towards nginx. Modules ngx_http_proxy_module and ngx_stream_proxy_module. And standard authorization can be passed using its proxy_header.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question