Amp\Artax\HttpSocketPool::tunnelThroughProxy PHP Method

tunnelThroughProxy() private method

private tunnelThroughProxy ( Amp\Deferred $promisor, $socket, $authority )
$promisor Amp\Deferred
    private function tunnelThroughProxy(Deferred $promisor, $socket, $authority)
    {
        if (empty(stream_context_get_options($socket)['artax*']['is_tunneled'])) {
            $futureTunnel = $this->tunneler->tunnel($socket, $authority);
            $futureTunnel->when(function ($error) use($promisor, $socket) {
                if ($error) {
                    $promisor->fail($error);
                } else {
                    $promisor->succeed($socket);
                }
            });
        } else {
            $promisor->succeed($socket);
        }
    }