|
@@ -70,7 +70,7 @@ class robot extends Command
|
|
|
$worker = new Worker();
|
|
|
$worker->onWorkerStart = function($worker) use($user, $room_id, $client_id){
|
|
|
//定义基本信息
|
|
|
- $http_addr = 'http://183.234.61.252:8090/';
|
|
|
+ $http_addr = env("APP_URL") . '/';
|
|
|
// $http_addr = 'http://www.dt.com/';
|
|
|
$client = new Client([
|
|
|
'cookies' => true,
|
|
@@ -84,13 +84,14 @@ class robot extends Command
|
|
|
]
|
|
|
]);
|
|
|
// $robot = $response->getBody()->getContents();
|
|
|
- $con = new AsyncTcpConnection('ws://183.234.61.252:8282');
|
|
|
+ $ws_connect_addr = env("WS_CONNECT_ADDR");
|
|
|
+ $con = new AsyncTcpConnection("ws://{$ws_connect_addr}");
|
|
|
// $con = new AsyncTcpConnection('ws://127.0.0.1:8282');
|
|
|
$con->onConnect = function($con) use($client, $worker) {
|
|
|
};
|
|
|
$con->onMessage = function($con, $data) use($client, &$room_id, &$client_id, $user, $http_addr, $worker){
|
|
|
//注册地址
|
|
|
- Gateway::$registerAddress = '127.0.0.1:1238';
|
|
|
+ Gateway::$registerAddress = env("WS_REGEDIT_ADDR");
|
|
|
//格式化参数
|
|
|
$json_data = json_decode($data);
|
|
|
//初始化
|