mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 17:20:35 +08:00
Fix: proper always real ip
This commit is contained in:
parent
da5350be98
commit
08a686beac
@ -41,7 +41,16 @@ const HOSTNAMES = [
|
|||||||
export const buildAlwaysRealIPModule = task(require.main === module, __filename)(async (span) => {
|
export const buildAlwaysRealIPModule = task(require.main === module, __filename)(async (span) => {
|
||||||
// Intranet, Router Setup, and mant more
|
// Intranet, Router Setup, and mant more
|
||||||
const dataset = [Object.entries(DIRECTS), Object.entries(LANS)];
|
const dataset = [Object.entries(DIRECTS), Object.entries(LANS)];
|
||||||
const surge = dataset.flatMap(data => data.flatMap(([, { domains }]) => domains.flatMap((domain) => [`*.${domain}`, domain])));
|
const surge = dataset.flatMap(data => data.flatMap(([, { domains }]) => domains.flatMap((domain) => {
|
||||||
|
switch (domain[0]) {
|
||||||
|
case '+':
|
||||||
|
return [`*.${domain.slice(1)}`];
|
||||||
|
case '$':
|
||||||
|
return [domain.slice(1)];
|
||||||
|
default:
|
||||||
|
return [domain, `*.${domain}`];
|
||||||
|
}
|
||||||
|
})));
|
||||||
|
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
compareAndWriteFile(
|
compareAndWriteFile(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user