mirror of
https://github.com/v2board/v2board.git
synced 2025-01-11 00:29:09 +08:00
Merge branch 'dev' of https://github.com/v2board/v2board into dev
This commit is contained in:
commit
9a68ff6c61
@ -73,8 +73,12 @@ class ClientController extends Controller
|
|||||||
private function shadowrocket($user, $vmess = [], $trojan = [])
|
private function shadowrocket($user, $vmess = [], $trojan = [])
|
||||||
{
|
{
|
||||||
$uri = '';
|
$uri = '';
|
||||||
//TODO: display remaining traffic and expire date
|
//display remaining traffic and expire date
|
||||||
//$uri .= 'STATUS=' . 'Traffic:' . 'Expiry:' . '\r\n';
|
$upload = round($user->u / (1024*1024*1024), 2);
|
||||||
|
$download = round($user->d / (1024*1024*1024), 2);
|
||||||
|
$totalTraffic = round($user->transfer_enable / (1024*1024*1024), 2);
|
||||||
|
$expiredDate = date('Y-m-d', $user->expired_at);
|
||||||
|
$uri .= "STATUS=🚀↑:{$upload}GB,↓:{$download}GB,TOT:{$totalTraffic}GB💡Expires:{$expiredDate}\r\n";
|
||||||
foreach ($vmess as $item) {
|
foreach ($vmess as $item) {
|
||||||
$uri .= Shadowrocket::buildVmess($user->uuid, $item);
|
$uri .= Shadowrocket::buildVmess($user->uuid, $item);
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ class Shadowrocket
|
|||||||
if (isset($wsSettings->path)) $config['path'] = $wsSettings->path;
|
if (isset($wsSettings->path)) $config['path'] = $wsSettings->path;
|
||||||
if (isset($wsSettings->headers->Host)) $config['obfsParam'] = $wsSettings->headers->Host;
|
if (isset($wsSettings->headers->Host)) $config['obfsParam'] = $wsSettings->headers->Host;
|
||||||
}
|
}
|
||||||
$query = http_build_query($config);
|
$query = http_build_query($config, null, '&', PHP_QUERY_RFC3986);
|
||||||
$uri = "vmess://{$userinfo}?{$query}&tfo=1";
|
$uri = "vmess://{$userinfo}?{$query}&tfo=1";
|
||||||
$uri .= "\r\n";
|
$uri .= "\r\n";
|
||||||
return $uri;
|
return $uri;
|
||||||
|
Loading…
Reference in New Issue
Block a user