Exemplo n.º 1
0
 protected function buildHeaderArray()
 {
     $this->handshakeChallenge = WebSocketFunctions::randHybiKey();
     $this->headers = array("GET" => "{$this->url} HTTP/1.1", "Connection:" => "Upgrade", "Host:" => "{$this->host}:{$this->port}", "Sec-WebSocket-Key:" => "{$this->handshakeChallenge}", "Sec-WebSocket-Origin:" => "{$this->origin}", "Sec-WebSocket-Version:" => 8, "Upgrade:" => "websocket");
     return $this->headers;
 }