This commit is contained in:
root 2019-11-06 22:52:59 +08:00
parent 17fd8dcca1
commit ac6bf673f3
2 changed files with 27 additions and 5 deletions

View File

@ -38,7 +38,15 @@ class ClientController extends Controller
private function quantumultX ($user, $server) {
$uri = '';
foreach($server as $item) {
$uri .= "vmess=".$item->host.":".$item->port.", method=none, password=".$user->v2ray_uuid.", over-tls=".($item->tls?'true':'false').", certificate=0, fast-open=false, udp-relay=false, tag=".$item->name."\r\n";
$uri .= "vmess=".$item->host.":".$item->port.", method=none, password=".$user->v2ray_uuid.", over-tls=".($item->tls?'true':'false').", certificate=0, fast-open=false, udp-relay=false, tag=".$item->name;
if ($item->network === 'ws') {
$uri .= ', obfs=ws';
if ($item->settings) {
$wsSettings = json_decode($item->settings);
if ($wsSettings->path) $uri .= ', obfs-uri='.$wsSettings->path;
}
}
$uri .= "\r\n";
}
return base64_encode($uri);
}
@ -47,7 +55,17 @@ class ClientController extends Controller
$uri = '';
header('subscription-userinfo: upload='.$user->u.'; download='.$user->d.';total='.$user->transfer_enable);
foreach($server as $item) {
$uri .= "vmess://".base64_encode($item->name.'= vmess, '.$item->host.', '.$item->port.', chacha20-ietf-poly1305, "'.$user->v2ray_uuid.'", over-tls='.($item->tls?"true":"false").', certificate=0, group='.config('v2board.app_name', 'V2Board'))."\r\n";
$str = '';
$str .= $item->name.'= vmess, '.$item->host.', '.$item->port.', chacha20-ietf-poly1305, "'.$user->v2ray_uuid.'", over-tls='.($item->tls?"true":"false").', certificate=0, group='.config('v2board.app_name', 'V2Board');
if ($item->network === 'ws') {
$str .= ', obfs=ws';
if ($item->settings) {
$wsSettings = json_decode($item->settings);
if ($wsSettings->path) $str .= ', obfs-path="'.$wsSettings->path.'"';
if ($wsSettings->headers->Host) $str .= ', obfs-header="Host:'.$wsSettings->headers->Host.'"';
}
}
$uri .= "vmess://".base64_encode($str)."\r\n";
}
return base64_encode($uri);
}
@ -61,11 +79,15 @@ class ClientController extends Controller
"port" => $item->port,
"id" => $user->v2ray_uuid,
"aid" => "2",
"net" => "tcp",
"net" => $item->network,
"type" => "chacha20-poly1305",
"host" => "",
"tls" => $item->tls?"tls":"",
];
if ($item->network == 'ws') {
$wsSettings = json_decode($item->settings);
if ($wsSettings->path) $config['path'] = $wsSettings->path;
}
$uri .= "vmess://".base64_encode(json_encode($config))."\r\n";
}
return base64_encode($uri);

View File

@ -107,9 +107,9 @@ class DeepbworkController extends Controller
break;
case 'http': $jsonData->inbound->streamSettings->httpSettings = json_decode($server->settings);
break;
case 'kcp': $jsonData->inbound->streamSettings->dsSettings = json_decode($server->settings);
case 'domainsocket': $jsonData->inbound->streamSettings->dsSettings = json_decode($server->settings);
break;
case 'kcp': $jsonData->inbound->streamSettings->quicSettings = json_decode($server->settings);
case 'quic': $jsonData->inbound->streamSettings->quicSettings = json_decode($server->settings);
break;
}
}