This commit is contained in:
Marcel Pociot
2020-09-07 22:25:27 +02:00
parent da8757744a
commit cfc0ad92a5
2 changed files with 6 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Client; namespace App\Client;
use App\Client\Http\HttpClient; use App\Client\Http\HttpClient;
use Ratchet\RFC6455\Messaging\Frame;
use function Ratchet\Client\connect; use function Ratchet\Client\connect;
use Ratchet\Client\WebSocket; use Ratchet\Client\WebSocket;
use React\EventLoop\LoopInterface; use React\EventLoop\LoopInterface;
@@ -56,7 +57,8 @@ class ProxyManager
$connector->connect('127.0.0.1:'.$connectionData->port)->then(function ($connection) use ($proxyConnection) { $connector->connect('127.0.0.1:'.$connectionData->port)->then(function ($connection) use ($proxyConnection) {
$connection->on('data', function ($data) 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) { $proxyConnection->on('message', function ($message) use ($connection) {

View File

@@ -3,6 +3,7 @@
namespace App\Server\Connections; namespace App\Server\Connections;
use Ratchet\ConnectionInterface; use Ratchet\ConnectionInterface;
use Ratchet\RFC6455\Messaging\Frame;
use React\Socket\Server; use React\Socket\Server;
class TcpControlConnection extends ControlConnection class TcpControlConnection extends ControlConnection
@@ -92,7 +93,8 @@ class TcpControlConnection extends ControlConnection
$this->proxy = $proxy; $this->proxy = $proxy;
$connection->on('data', function ($data) use ($proxy) { $connection->on('data', function ($data) use ($proxy) {
$proxy->send($data); $binaryMsg = new Frame($data, true, Frame::OP_BINARY);
$proxy->send($binaryMsg);
}); });
$connection->resume(); $connection->resume();