diff --git a/app/Client/ProxyManager.php b/app/Client/ProxyManager.php index 0b784de..82271de 100644 --- a/app/Client/ProxyManager.php +++ b/app/Client/ProxyManager.php @@ -3,6 +3,7 @@ namespace App\Client; use App\Client\Http\HttpClient; +use Ratchet\RFC6455\Messaging\Frame; use function Ratchet\Client\connect; use Ratchet\Client\WebSocket; use React\EventLoop\LoopInterface; @@ -56,7 +57,8 @@ class ProxyManager $connector->connect('127.0.0.1:'.$connectionData->port)->then(function ($connection) use ($proxyConnection) { $connection->on('data', function ($data) use ($proxyConnection) { - $proxyConnection->send($data); + $binaryMsg = new Frame($data, true, Frame::OP_BINARY); + $proxyConnection->send($binaryMsg); }); $proxyConnection->on('message', function ($message) use ($connection) { diff --git a/app/Server/Connections/TcpControlConnection.php b/app/Server/Connections/TcpControlConnection.php index 53baf9e..db5c284 100644 --- a/app/Server/Connections/TcpControlConnection.php +++ b/app/Server/Connections/TcpControlConnection.php @@ -3,6 +3,7 @@ namespace App\Server\Connections; use Ratchet\ConnectionInterface; +use Ratchet\RFC6455\Messaging\Frame; use React\Socket\Server; class TcpControlConnection extends ControlConnection @@ -92,7 +93,8 @@ class TcpControlConnection extends ControlConnection $this->proxy = $proxy; $connection->on('data', function ($data) use ($proxy) { - $proxy->send($data); + $binaryMsg = new Frame($data, true, Frame::OP_BINARY); + $proxy->send($binaryMsg); }); $connection->resume();