This commit is contained in:
root 2019-12-31 13:45:50 +08:00
parent fae5ef21e6
commit e1fce3ae37
2 changed files with 7 additions and 7 deletions

View File

@ -48,7 +48,7 @@ class ClientController extends Controller
$uri .= ', obfs=ws';
if ($item->settings) {
$wsSettings = json_decode($item->settings);
if ($wsSettings->path) $uri .= ', obfs-uri='.$wsSettings->path;
if (isset($wsSettings->path)) $uri .= ', obfs-uri='.$wsSettings->path;
}
}
$uri .= "\r\n";
@ -66,8 +66,8 @@ class ClientController extends Controller
$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.'"';
if (isset($wsSettings->path)) $str .= ', obfs-path="'.$wsSettings->path.'"';
if (isset($wsSettings->headers->Host)) $str .= ', obfs-header="Host:'.$wsSettings->headers->Host.'"';
}
}
$uri .= "vmess://".base64_encode($str)."\r\n";
@ -103,8 +103,8 @@ class ClientController extends Controller
$array['network'] = $item->network;
if ($item->settings) {
$wsSettings = json_decode($item->settings);
if ($wsSettings->path) $array['ws-path'] = $wsSettings->path;
if ($wsSettings->headers->Host) $array['ws-headers'] = [
if (isset($wsSettings->path)) $array['ws-path'] = $wsSettings->path;
if (isset($wsSettings->headers->Host)) $array['ws-headers'] = [
'Host' => $wsSettings->headers->Host
];
}

View File

@ -66,8 +66,8 @@ class Helper
];
if ($item->network == 'ws') {
$wsSettings = json_decode($item->settings);
if ($wsSettings->path) $config['path'] = $wsSettings->path;
if ($wsSettings->headers->Host) $config['host'] = $wsSettings->headers->Host;
if (isset($wsSettings->path)) $config['path'] = $wsSettings->path;
if (isset($wsSettings->headers->Host)) $config['host'] = $wsSettings->headers->Host;
}
return "vmess://".base64_encode(json_encode($config))."\r\n";
}