protected function getClientUrl() {
        $protocol = isset($_SERVER['HTTP_X_FORWARDED_PROTO'])
            ? $_SERVER['HTTP_X_FORWARDED_PROTO']
            : isset($_SERVER['REQUEST_SCHEME'])
              ? $_SERVER['REQUEST_SCHEME']
              : (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on')
                ? 'https'
                : 'http';
            
        $host = $_SERVER['HTTP_HOST'];

        $request_uri = $_SERVER['REQUEST_URI'];
        
        return $protocol
            . '://'
            . $host
            . $request_uri;
    }