mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-16 15:05:56 +00:00
wip
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user