[Http] Refactor header parsing from WS to HTTP
This commit is contained in:
parent
7b2b6897e5
commit
423b5cc355
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\WebSocket\Guzzle\Http\Message;
|
||||
namespace Ratchet\Http\Guzzle\Http\Message;
|
||||
use Guzzle\Http\Message\RequestFactory as GuzzleRequestFactory;
|
||||
use Guzzle\Http\EntityBody;
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
namespace Ratchet\WebSocket;
|
||||
namespace Ratchet\Http;
|
||||
use Ratchet\MessageInterface;
|
||||
use Ratchet\ConnectionInterface;
|
||||
use Ratchet\WebSocket\Guzzle\Http\Message\RequestFactory;
|
||||
use Ratchet\Http\Guzzle\Http\Message\RequestFactory;
|
||||
|
||||
/**
|
||||
* This class receives streaming data from a client request
|
@ -3,9 +3,6 @@ namespace Ratchet\Http;
|
||||
use Ratchet\MessageComponentInterface;
|
||||
use Ratchet\ConnectionInterface;
|
||||
|
||||
// @todo This class will move to this namespace
|
||||
use Ratchet\WebSocket\HttpRequestParser;
|
||||
|
||||
use Symfony\Component\Routing\RouteCollection;
|
||||
|
||||
class HttpServer implements MessageComponentInterface {
|
||||
@ -15,6 +12,11 @@ class HttpServer implements MessageComponentInterface {
|
||||
*/
|
||||
protected $_decorating;
|
||||
|
||||
/**
|
||||
* Buffers incoming HTTP requests returning a Guzzle Request when coalesced
|
||||
* @var HttpRequestParser
|
||||
* @note May not expose this in the future, may do through facade methods
|
||||
*/
|
||||
protected $_reqParser;
|
||||
|
||||
/**
|
||||
|
@ -2,12 +2,11 @@
|
||||
namespace Ratchet\WebSocket;
|
||||
use Ratchet\MessageComponentInterface;
|
||||
use Ratchet\ConnectionInterface;
|
||||
use Ratchet\Http\HttpServerInterface;
|
||||
use Guzzle\Http\Message\RequestInterface;
|
||||
use Guzzle\Http\Message\Response;
|
||||
use Ratchet\WebSocket\Version;
|
||||
use Ratchet\WebSocket\Encoding\ToggleableValidator;
|
||||
use Guzzle\Http\Message\Response;
|
||||
|
||||
use Guzzle\Http\Message\RequestInterface;
|
||||
use Ratchet\Http\HttpServerInterface;
|
||||
|
||||
/**
|
||||
* The adapter to handle WebSocket requests/responses
|
||||
@ -16,13 +15,6 @@ use Ratchet\Http\HttpServerInterface;
|
||||
* @link http://dev.w3.org/html5/websockets/
|
||||
*/
|
||||
class WsServer implements HttpServerInterface {
|
||||
/**
|
||||
* Buffers incoming HTTP requests returning a Guzzle Request when coalesced
|
||||
* @var HttpRequestParser
|
||||
* @note May not expose this in the future, may do through facade methods
|
||||
*/
|
||||
public $reqParser;
|
||||
|
||||
/**
|
||||
* Manage the various WebSocket versions to support
|
||||
* @var VersionManager
|
||||
@ -65,7 +57,6 @@ class WsServer implements HttpServerInterface {
|
||||
* If you want to enable sub-protocols have your component implement WsServerInterface as well
|
||||
*/
|
||||
public function __construct(MessageComponentInterface $component) {
|
||||
$this->reqParser = new HttpRequestParser;
|
||||
$this->versioner = new VersionManager;
|
||||
$this->validator = new ToggleableValidator;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user