I am looking to create a direct connection between a remote server and a client, where the data transfer is controlled by a PHP script. The script would be responsible for determining what chunks of data to transfer from the remote server to the client; I don't want the data to transfer through the server hosting the PHP script.
Essentially, I am trying to stream data from a remote server to a client, where the transferred chunks of data is controlled by a PHP script.
I took a look at PHP's stream functions (http://php.net/manual/en/book.stream.php), but this does not seem to provide a solution.
Does PHP provide a function to select a specific range of bytes from a remote file, and transfer it directly to the client?