From f2db5c6b30b69d9b6643f921f7a273a4179a108a Mon Sep 17 00:00:00 2001 From: Dmitry Tretyakov <76806170+tretdm@users.noreply.github.com> Date: Tue, 14 Apr 2026 18:14:13 +0700 Subject: [PATCH 1/3] Add HTTP media streaming over GET support for non-VK servers --- vkrelay/apirelay.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vkrelay/apirelay.php b/vkrelay/apirelay.php index 531d7cd..82acfdd 100644 --- a/vkrelay/apirelay.php +++ b/vkrelay/apirelay.php @@ -4,10 +4,13 @@ header("Content-Type: text/json"); - $request = file_get_contents("php://input"); + if(isset($_GET["goto"])) + $request = $_GET["goto"]; + else + $request = file_get_contents("php://input"); $curl = curl_init($request); curl_exec($curl); header("Content-length: " . ob_get_length()); - ob_flush(); \ No newline at end of file + ob_flush(); From ce7fb13d224257627fec380febd9f92d79ce53ca Mon Sep 17 00:00:00 2001 From: Dmitry Tretyakov <76806170+tretdm@users.noreply.github.com> Date: Tue, 14 Apr 2026 18:30:58 +0700 Subject: [PATCH 2/3] Update apirelay.php --- vkrelay/apirelay.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/vkrelay/apirelay.php b/vkrelay/apirelay.php index 82acfdd..e1e4d60 100644 --- a/vkrelay/apirelay.php +++ b/vkrelay/apirelay.php @@ -2,15 +2,22 @@ ob_start(); error_reporting(E_ALL); - header("Content-Type: text/json"); - if(isset($_GET["goto"])) + if(strlen($_GET["goto"]) > 0) $request = $_GET["goto"]; else $request = file_get_contents("php://input"); $curl = curl_init($request); curl_exec($curl); + + $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + + if($statusCode === 301 && str_starts_with($request, "http://")) { + $request = str_replace("http://", "https://", $request); + $curl = curl_init($request); + curl_exec($curl); + } header("Content-length: " . ob_get_length()); ob_flush(); From 469c6683d030f833f10fc87564122e237384da5d Mon Sep 17 00:00:00 2001 From: Dmitry Tretyakov <76806170+tretdm@users.noreply.github.com> Date: Tue, 14 Apr 2026 18:36:06 +0700 Subject: [PATCH 3/3] =?UTF-8?q?=D0=97=D0=B0=D0=B1=D1=8B=D0=BB=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=B1=D0=BA=D1=83,=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D1=8C=20=D0=B2=D1=81=D0=B5=20=D0=B4=D0=BE=D0=BB=D0=B6=D0=BD?= =?UTF-8?q?=D0=BE=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vkrelay/apirelay.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vkrelay/apirelay.php b/vkrelay/apirelay.php index e1e4d60..c129e72 100644 --- a/vkrelay/apirelay.php +++ b/vkrelay/apirelay.php @@ -11,7 +11,7 @@ $curl = curl_init($request); curl_exec($curl); - $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); if($statusCode === 301 && str_starts_with($request, "http://")) { $request = str_replace("http://", "https://", $request);