public static function retrieve(array $server = null)
    {
        if (empty($server)) {
            $server = $_SERVER;
        }

        if (isset($server['SERVER_NAME'])) {
            return $server['SERVER_NAME'];
        }

        $address = '';

        if (isset($server['SERVER_ADDR'])) {
            $address = $server['SERVER_ADDR'];
        }

        if (isset($server['LOCAL_ADDR'])) {
            $address = $server['LOCAL_ADDR'];
        }

        if (false !== strpos($address, ':')) {
            $address = '[' . $address . ']';
        }

        if ($address) {
            return $address;
        }
    }