Reverse port detection when not using reverse proxy

This commit is contained in:
LatoWolf
2026-05-26 15:55:24 +08:00
parent b052f6bee9
commit 09eeb14cdc
2 changed files with 6 additions and 1 deletions

View File

@@ -94,7 +94,11 @@ export const services = (port: number, plugins: EamusePlugin[]) => {
const host = (info as any).host;
const protocol = (info as any).protocol || 'http';
const url = `${protocol}://${host}`;
const url = (info as any).proxy
? `${protocol}://${host}`
: port == 80
? `http://${host}`
: `http://${host}:${port}`;
for (const moduleName of coreModules) {
services.item.push({ '@attr': { name: moduleName, url } });

View File

@@ -202,6 +202,7 @@ export const EamuseRoute = (router: EamuseRootRouter): RequestHandler => {
? stripPort(forwardedHost)
: req.get('host') || req.hostname;
(info as any).protocol = forwardedProto || req.protocol;
(info as any).proxy = Boolean(forwardedHost || forwardedProto);
}
try {