Skip to content

Instantly share code, notes, and snippets.

@autch
Created March 28, 2011 16:31
Show Gist options
  • Save autch/890781 to your computer and use it in GitHub Desktop.
Save autch/890781 to your computer and use it in GitHub Desktop.
gist:890759 で受け取ったTSへのリバースプロキシ
<?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