public function proxyRead()
    {
        $proxyState = $this->proxyState;
        Client::debug('proxy readState: ', $proxyState);
        if ($proxyState === 2) {
            $buf = $this->read(2);
            if ($buf === "\x05\x00") {
                $this->proxyState = 5;
            } elseif ($buf === "\x05\x02") {
                $this->proxyState = 3;
            }
        } elseif ($proxyState === 4) {
            $buf = $this->read(2);
            if ($buf === "\x01\x00") {
                $this->proxyState = 5;
            }
        } elseif ($proxyState === 6) {
            $buf = $this->read(10);
            if (substr($buf, 0, 4) === "\x05\x00\x00\x01") {
                $this->proxyState = 0;
            }
        }
        return $proxyState !== $this->proxyState;
    }