mirror of
https://github.com/v2board/v2board.git
synced 2025-02-11 07:59:11 +08:00
fix tls
This commit is contained in:
parent
ce6bd80702
commit
87e0d34961
@ -110,11 +110,11 @@ class DeepbworkController extends Controller
|
|||||||
$nodeId = $request->input('node_id');
|
$nodeId = $request->input('node_id');
|
||||||
$localPort = $request->input('local_port');
|
$localPort = $request->input('local_port');
|
||||||
if (empty($nodeId) || empty($localPort)) {
|
if (empty($nodeId) || empty($localPort)) {
|
||||||
abort(1000, '参数错误');
|
abort(500, '参数错误');
|
||||||
}
|
}
|
||||||
$server = Server::find($nodeId);
|
$server = Server::find($nodeId);
|
||||||
if (!$server) {
|
if (!$server) {
|
||||||
abort(1001, '节点不存在');
|
abort(500, '节点不存在');
|
||||||
}
|
}
|
||||||
$json = json_decode(self::SERVER_CONFIG);
|
$json = json_decode(self::SERVER_CONFIG);
|
||||||
$json->inboundDetour[0]->port = (int)$localPort;
|
$json->inboundDetour[0]->port = (int)$localPort;
|
||||||
@ -143,8 +143,12 @@ class DeepbworkController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((int)$server->tls) {
|
if ((int)$server->tls) {
|
||||||
$json->inbound->streamSettings->security = "tls";
|
$json->inbound->streamSettings->security = 'tls';
|
||||||
$tls = (object)array("certificateFile" => "/home/v2ray.crt", "keyFile" => "/home/v2ray.key");
|
$tls = (object)[
|
||||||
|
'certificateFile' => '/home/v2ray.crt',
|
||||||
|
'keyFile' => '/home/v2ray.key'
|
||||||
|
];
|
||||||
|
$json->inbound->streamSettings->tlsSettings = new \StdClass();
|
||||||
$json->inbound->streamSettings->tlsSettings->certificates[0] = $tls;
|
$json->inbound->streamSettings->tlsSettings->certificates[0] = $tls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user