Contao\Environment::ip PHP Method

ip() protected static method

Return the real REMOTE_ADDR even if a proxy server is used
protected static ip ( ) : string
return string The IP address of the client
    protected static function ip()
    {
        $request = \System::getContainer()->get('request_stack')->getCurrentRequest();
        if ($request === null) {
            return '';
        }
        return $request->getClientIp();
    }