mxmbsocket/lib/Ratchet/Application/WebSocket/Version/HyBi10.php
Chris Boden 788b1f66cc RFC handshake verification + unit tests
Went through section 4 of RFC 6455 making sure incoming handshake was valid with accompanying unit tests
2011-12-02 23:58:08 -05:00

32 lines
777 B
PHP

<?php
namespace Ratchet\Application\WebSocket\Version;
/**
* @todo Note: Even though this is the "legacy" HyBi version, it's using the RFC Message and Frame classes - change if needed
*/
class HyBi10 extends RFC6455 {
public static function isProtocol(array $headers) {
if (isset($headers['Sec-Websocket-Version'])) {
if ((int)$headers['Sec-Websocket-Version'] >= 6 && (int)$headers['Sec-Websocket-Version'] < 13) {
return true;
}
}
return false;
}
/**
* @return HyBi10\Message
* /
public function newMessage() {
return new HyBi10\Message;
}
/**
* @return HyBi10\Frame
* /
public function newFrame() {
return new HyBi10\Frame;
}
/**/
}