Skip to content

Commit

Permalink
Merge 33d4e57 into 3751ec5
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisBosquez committed Nov 10, 2017
2 parents 3751ec5 + 33d4e57 commit 87a08f4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Connection.php
Expand Up @@ -220,7 +220,13 @@ protected function makeHandshake($origin = FALSE)

@fwrite($this->_socket, $header);
$response = @fread($this->_socket, 1500);


if(!$response)
{
$this->error("Couldn't get a response from server", 500);
die();
}

preg_match('#Sec-WebSocket-Accept:\s(.*)$#mU', $response, $matches);
$keyAccept = trim($matches[1]);
$expectedResponse = base64_encode(pack('H*', sha1($key . '258EAFA5-E914-47DA-95CA-C5AB0DC85B11')));
Expand Down

0 comments on commit 87a08f4

Please sign in to comment.