diff --git a/epp/config.php.dist b/epp/config.php.dist index 533c4b6..84d64bc 100644 --- a/epp/config.php.dist +++ b/epp/config.php.dist @@ -7,8 +7,7 @@ return [ 'db_database' => 'registry', 'db_username' => 'your_username', 'db_password' => 'your_password', - 'epp_host' => '0.0.0.0', - 'epp_host_ipv6' => '::', // Set to false if no IPv6 support + 'epp_host' => '::', // Set to 0.0.0.0 if no IPv6 support 'epp_port' => 700, 'epp_pid' => '/var/run/epp.pid', 'epp_greeting' => 'Namingo EPP Server 1.0', diff --git a/epp/start_epp.php b/epp/start_epp.php index 6dc56a0..ff4a30d 100644 --- a/epp/start_epp.php +++ b/epp/start_epp.php @@ -48,9 +48,6 @@ $pool = new Swoole\Database\PDOPool( Swoole\Runtime::enableCoroutine(); $server = new Server($c['epp_host'], $c['epp_port']); -if ($c['epp_host_ipv6'] !== false) { - //$server->addListener($c['epp_host_ipv6'], $c['epp_port'], SWOOLE_SOCK_TCP6); -} $server->set([ 'enable_coroutine' => true, 'log_file' => '/var/log/namingo/epp_application.log', @@ -78,7 +75,7 @@ $log->info('Namingo EPP server started'); $server->handle(function (Connection $conn) use ($table, $pool, $c, $log, $permittedIPsTable, $rateLimiter) { // Get the client information $clientInfo = $conn->exportSocket()->getpeername(); - $clientIP = $clientInfo['address'] ?? ''; + $clientIP = isset($clientInfo['address']) ? (strpos($clientInfo['address'], '::ffff:') === 0 ? substr($clientInfo['address'], 7) : $clientInfo['address']) : ''; // Check if the IP is in the permitted list if (!$permittedIPsTable->exist($clientIP)) {