Amp\Artax\HttpTunneler::tunnel PHP 메소드

tunnel() 공개 메소드

Establish an HTTP tunnel to the specified authority over this socket
public tunnel ( resource $socket, string $authority ) : Amp\Promise
$socket resource
$authority string
리턴 Amp\Promise
    public function tunnel($socket, $authority)
    {
        $struct = new HttpTunnelStruct();
        $struct->promisor = new Deferred();
        $struct->socket = $socket;
        $struct->writeBuffer = "CONNECT {$authority} HTTP/1.1\r\n\r\n";
        $this->doWrite($struct);
        return $struct->promisor->promise();
    }