1
我有一个发布请求php代码,我用它来获取流式URL,所以我可以将它们广播给我的访问者。 显然,我使用的其他订阅服务具有更强的安全性,并且它要求仅从您首先发送请求才能获取该流式URL的IP访问流式URL。向访问者网络发送帖子请求?可能?
因此,当用户打开channel1.php实际POST请求是从他的IP地址(而不是我的服务器上)发送这样他就可以观看流,我需要。 可能吗?
下面是代码
<?php
$params = array ('password' => 'mypassword', 'username' => 'mysecretusername');
$query = http_build_query ($params);
$contextData = array (
'method' => 'POST',
'header' => "Connection: close\r\n".
"Content-Length: ".strlen($query)."\r\n"."User-Agent: okhttp/2.5.0",
'content'=> $query);
$context = stream_context_create (array ('http' => $contextData));
$result = file_get_contents (
'http://api.source.stream/streams/1/sign', // page url
false,
$context);
$json = json_decode($result, true);
$pink = $json[url];
echo $json[url];
?>