summaryrefslogtreecommitdiff
path: root/Game/Lobby/Server/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'Game/Lobby/Server/index.php')
-rw-r--r--Game/Lobby/Server/index.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/Game/Lobby/Server/index.php b/Game/Lobby/Server/index.php
index ae734a6..1086d24 100644
--- a/Game/Lobby/Server/index.php
+++ b/Game/Lobby/Server/index.php
@@ -36,7 +36,7 @@ if (php_sapi_name() == 'cli') {
return;
}
-$url = parse_url("$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
+$url = parse_url("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
$method = $_SERVER['REQUEST_METHOD'];
if ($method == 'POST') {
@@ -49,7 +49,10 @@ if ($method == 'POST') {
$response = [];
if ($method == 'POST' && $url['path'] == '/host') {
- $ip = filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP);
+ $ip = filter_var(
+ $_SERVER['HTTP_X_FORWARDED_FOR'] ?? $_SERVER['REMOTE_ADDR'],
+ FILTER_VALIDATE_IP
+ );
if ($ip === false) {
$response = [