This commit is contained in:
Chris Boden 2012-04-26 20:05:53 -04:00
parent c2642e1c74
commit 45c44fb841
3 changed files with 5 additions and 1 deletions

View File

@ -87,7 +87,7 @@ class WAMPServerComponent implements WebSocketComponentInterface {
}; };
$welcome = new Welcome($conn); $welcome = new Welcome($conn);
$welcome->setWelcome($conn->WAMP->sessionId, 'Ratchet/0.1'); $welcome->setWelcome($conn->WAMP->sessionId, \Ratchet\Resource\VERSION);
$this->_msg_buffer->enqueue($welcome); $this->_msg_buffer->enqueue($welcome);
return $this->attachStack($this->_decorating->onOpen($conn)); return $this->attachStack($this->_decorating->onOpen($conn));

View File

@ -62,6 +62,7 @@ class WebSocketComponent implements MessageComponentInterface {
/** /**
* Do handshake, frame/unframe messages coming/going in stack * Do handshake, frame/unframe messages coming/going in stack
* {@inheritdoc}
*/ */
public function onMessage(ConnectionInterface $from, $msg) { public function onMessage(ConnectionInterface $from, $msg) {
if (true !== $from->WebSocket->handshake) { if (true !== $from->WebSocket->handshake) {
@ -92,6 +93,7 @@ class WebSocketComponent implements MessageComponentInterface {
if (count($agreed_protocols) > 0) { if (count($agreed_protocols) > 0) {
$response->setHeader('Sec-WebSocket-Protocol', implode(',', $agreed_protocols)); $response->setHeader('Sec-WebSocket-Protocol', implode(',', $agreed_protocols));
} }
$response->setHeader('X-Powered-By', \Ratchet\Resource\VERSION);
$header = (string)$response; $header = (string)$response;
$comp = $this->_factory->newComposite(); $comp = $this->_factory->newComposite();

View File

@ -1,5 +1,7 @@
<?php <?php
namespace Ratchet\Resource; namespace Ratchet\Resource;
const VERSION = 'Ratchet/0.1';
interface ConnectionInterface { interface ConnectionInterface {
} }