Simplify proxy routing and configuration

This commit is contained in:
2026-07-11 04:42:16 +03:00
parent efa46d1ee5
commit d3b7f0d613
22 changed files with 786 additions and 787 deletions

View File

@@ -607,7 +607,7 @@ function publicState() {
const customRules = readJson(settings.customRulesPath, []);
const deviceProfiles = readDeviceProfiles();
const clientSettings = readClientSettings();
const { subscriptionUrl, ...rest } = state;
const { subscriptionUrl, servers = [], ...rest } = state;
return {
mode: settings.appMode,
port: settings.port,
@@ -640,6 +640,10 @@ function publicState() {
directBypassAvailable: IPSET_AVAILABLE,
sourceBypassCidrs: sourceBypassCidrs(deviceProfiles),
...rest,
servers: servers.map((server) => ({
...server,
tag: String(server.tag || '').trim(),
})),
};
}
@@ -1324,7 +1328,7 @@ async function handleApi(req, res) {
servers.map(async (server) => {
const ping = await tcpPing(server.server, server.server_port, 3000);
return {
tag: server.tag,
tag: String(server.tag || '').trim(),
...ping,
checkedAt: new Date().toISOString(),
};