|
@@ -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);
|