Https1TunnelConnector example

 else {
                $context = $context->withBindTo($options['bindto']);
            }
        }

        if ($options['proxy']) {
            $proxyUrl = parse_url($options['proxy']['url']);
            $proxySocket = new SocketAddress($proxyUrl['host']$proxyUrl['port']);
            $proxyHeaders = $options['proxy']['auth'] ? ['Proxy-Authorization' => $options['proxy']['auth']] : [];

            if ('ssl' === $proxyUrl['scheme']) {
                $connector = new Https1TunnelConnector($proxySocket$context->getTlsContext()$proxyHeaders$connector);
            } else {
                $connector = new Http1TunnelConnector($proxySocket$proxyHeaders$connector);
            }
        }

        $maxHostConnections = 0 < $this->maxHostConnections ? $this->maxHostConnections : \PHP_INT_MAX;
        $pool = new DefaultConnectionFactory($connector$context);
        $pool = ConnectionLimitingPool::byAuthority($maxHostConnections$pool);

        return $this->clients[$key] = [($this->clientConfigurator)(new PooledHttpClient($pool))$handleConnector];
    }

    
Home | Imprint | This part of the site doesn't use cookies.