Created
March 28, 2011 16:31
-
-
Save autch/890781 to your computer and use it in GitHub Desktop.
gist:890759 で受け取ったTSへのリバースプロキシ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // bogus reverse-proxy for VLC http streaming output | |
ini_set("display_errors", 0); | |
ini_set("log_errors", 1); | |
if(isset($_REQUEST['port'])) | |
$port = intval($_REQUEST['port']); | |
else | |
$port = 12234; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, "http://127.0.0.1:%d/ts"); | |
curl_setopt($ch, CURLOPT_HEADER, FALSE); | |
curl_setopt($ch, CURLOPT_PORT, $port); | |
header("Content-Type: video/mpegts"); | |
curl_exec($ch); | |
curl_close($ch); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment