This commit is contained in:
root 2019-11-06 01:12:40 +08:00
parent 9345c9c807
commit 3dae3e9e0f
2 changed files with 18 additions and 1 deletions

View File

@ -96,6 +96,23 @@ class DeepbworkController extends Controller
$jsonData = json_decode(self::SERVER_CONFIG);
$jsonData->inboundDetour[0]->port = (int)$localPort;
$jsonData->inbound->port = (int)$server->server_port;
$jsonData->inbound->streamSettings->network = $server->network;
if ($server->settings) {
switch ($server->network) {
case 'tcp': $jsonData->inbound->streamSettings->tcpSettings = json_decode($server->settings);
break;
case 'kcp': $jsonData->inbound->streamSettings->kcpSettings = json_decode($server->settings);
break;
case 'ws': $jsonData->inbound->streamSettings->wsSettings = json_decode($server->settings);
break;
case 'http': $jsonData->inbound->streamSettings->httpSettings = json_decode($server->settings);
break;
case 'kcp': $jsonData->inbound->streamSettings->dsSettings = json_decode($server->settings);
break;
case 'kcp': $jsonData->inbound->streamSettings->quicSettings = json_decode($server->settings);
break;
}
}
if ((int)$server->tls) {
$jsonData->inbound->streamSettings->security = "tls";
$tls = (object) array("certificateFile" => "/home/v2ray.crt", "keyFile" => "/home/v2ray.key");

View File

@ -22,7 +22,7 @@ class ServerSave extends FormRequest
'tls' => 'required',
'tags' => 'array',
'rate' => 'required|numeric',
'network' => 'required|in:tcp,mkcp,websocket,http2,domainsocket,quic'
'network' => 'required|in:tcp,kcp,ws,http,domainsocket,quic'
];
}