From d9f24249d883477fced2da4296ff902d82e471ea Mon Sep 17 00:00:00 2001 From: Matko Andjelinic Date: Sat, 24 Oct 2020 00:38:38 +0200 Subject: [PATCH] use permessage-deflate --- src/WebSocket.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/WebSocket.php b/src/WebSocket.php index baebb0c..57744ff 100755 --- a/src/WebSocket.php +++ b/src/WebSocket.php @@ -2,6 +2,7 @@ namespace Ratchet\Client; use Evenement\EventEmitterTrait; use Evenement\EventEmitterInterface; +use Ratchet\RFC6455\Handshake\PermessageDeflateOptions; use React\Socket\ConnectionInterface; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; @@ -100,7 +101,11 @@ function(FrameInterface $frame) use (&$streamer) { false, function() use ($reusableUAException) { return $reusableUAException; - } + }, + null, + null, + [$this->_stream, 'write'], + PermessageDeflateOptions::fromRequestOrResponse($response)[0] ); $stream->on('data', [$streamer, 'onData']);