diff --git a/src/Middleware/TelescopeMiddleware.php b/src/Middleware/TelescopeMiddleware.php index 65c5568..fc2bed7 100644 --- a/src/Middleware/TelescopeMiddleware.php +++ b/src/Middleware/TelescopeMiddleware.php @@ -72,7 +72,7 @@ public function requestHandled($request, $response) /** @var Dispatched $dispatched */ $dispatched = $psr7Request->getAttribute(Dispatched::class); $entry = IncomingEntry::make([ - 'ip_address' => $psr7Request->getServerParams()['remote_addr'], + 'ip_address' => $psr7Request->getHeaderLine('x-real-ip') ?: $psr7Request->getServerParams()['remote_addr'] ?? 'unknown', 'uri' => $psr7Request->getRequestTarget(), 'method' => $psr7Request->getMethod(), 'controller_action' => $dispatched->handler ? $dispatched->handler->callback : '',