diff --git a/composer.json b/composer.json index 331fc49..d7a09ec 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,8 @@ , "require": { "php": ">=5.4" , "evenement/evenement": "^3.0 || ^2.0" - , "ratchet/rfc6455": "^0.3" + , "guzzlehttp/psr7": "^2.0 || ^1.7" + , "ratchet/rfc6455": "^0.3.1" , "react/socket": "^1.9" } , "require-dev": { diff --git a/src/Connector.php b/src/Connector.php index b407d2f..0327469 100644 --- a/src/Connector.php +++ b/src/Connector.php @@ -85,10 +85,10 @@ public function __invoke($url, array $subProtocols = [], array $headers = []) { $stream->removeListener('data', $headerParser); - $response = gPsr\parse_response($buffer); + $response = gPsr\Message::parseResponse($buffer); if (!$this->_negotiator->validateResponse($request, $response)) { - $futureWsConn->reject(new \DomainException(gPsr\str($response))); + $futureWsConn->reject(new \DomainException(gPsr\Message::toString($response))); $stream->close(); return; @@ -110,7 +110,7 @@ public function __invoke($url, array $subProtocols = [], array $headers = []) { }; $stream->on('data', $headerParser); - $stream->write(gPsr\str($request)); + $stream->write(gPsr\Message::toString($request)); }, array($futureWsConn, 'reject')); return $futureWsConn->promise(); @@ -124,7 +124,7 @@ public function __invoke($url, array $subProtocols = [], array $headers = []) { * @return \Psr\Http\Message\RequestInterface */ protected function generateRequest($url, array $subProtocols, array $headers) { - $uri = gPsr\uri_for($url); + $uri = gPsr\Utils::uriFor($url); $scheme = $uri->getScheme();