Simplify proxy routing and configuration
This commit is contained in:
@@ -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(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user