20 lines
617 B
PHP
20 lines
617 B
PHP
<?php
|
|
// Arsenal reverse proxy via private network to S95
|
|
$base = "http://10.1.0.3:5890";
|
|
$path = $_SERVER['PATH_INFO'] ?? $_GET['p'] ?? '/menu.html';
|
|
$url = $base . $path;
|
|
$ch = curl_init($url);
|
|
curl_setopt_array($ch, [
|
|
CURLOPT_RETURNTRANSFER => true,
|
|
CURLOPT_TIMEOUT => 30,
|
|
CURLOPT_FOLLOWLOCATION => true,
|
|
CURLOPT_HTTPHEADER => ['X-Forwarded-For: ' . $_SERVER['REMOTE_ADDR']]
|
|
]);
|
|
$body = curl_exec($ch);
|
|
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
|
$type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
|
|
curl_close($ch);
|
|
http_response_code($code);
|
|
if ($type) header("Content-Type: $type");
|
|
echo $body;
|