尝试下发clash系的h2配置

This commit is contained in:
root 2023-09-20 16:19:54 +09:00
parent f7f533b3f7
commit 9d3fdb6ee5
2 changed files with 18 additions and 1 deletions

View File

@ -217,6 +217,15 @@ class ClashMeta
if (isset($grpcSettings['serviceName'])) $array['grpc-opts']['grpc-service-name'] = $grpcSettings['serviceName'];
}
}
if ($server['network'] === 'h2') {
$array['network'] = 'h2';
if ($server['network_settings']) {
$h2Settings = $server['network_settings'];
$array['h2-opts'] = [];
if (isset($h2Settings['host'])) $array['h2-opts']['host'] = array($h2Settings['host']);
if (isset($h2Settings['path'])) $array['h2-opts']['path'] = $h2Settings['path'];
}
}
return $array;
}

View File

@ -217,7 +217,15 @@ class ClashVerge
if (isset($grpcSettings['serviceName'])) $array['grpc-opts']['grpc-service-name'] = $grpcSettings['serviceName'];
}
}
if ($server['network'] === 'h2') {
$array['network'] = 'h2';
if ($server['network_settings']) {
$h2Settings = $server['network_settings'];
$array['h2-opts'] = [];
if (isset($h2Settings['host'])) $array['h2-opts']['host'] = array($h2Settings['host']);
if (isset($h2Settings['path'])) $array['h2-opts']['path'] = $h2Settings['path'];
}
}
return $array;
}