Skip to content

Commit

Permalink
fix: external provider 的 addresses 参数只应该写 IP
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed Feb 24, 2020
1 parent 4f86829 commit f7006d6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
VmessNodeConfig,
} from '../types';
import { NETWORK_TIMEOUT, OBFS_UA, PROVIDER_CACHE_MAXAGE, PROXY_TEST_INTERVAL, PROXY_TEST_URL } from './constant';
import { isIp } from './dns';
import { validateFilter } from './filter';
import { parseSSRUri } from './ssr';
import { formatVmessUri } from './v2ray';
Expand Down Expand Up @@ -442,7 +443,9 @@ export const getSurgeNodes = (
configString.push(...config.hostnameIp.map(item => `addresses = ${item}`));
}

configString.push(`addresses = ${config.hostname}`);
if (isIp(config.hostname)) {
configString.push(`addresses = ${config.hostname}`);
}

return ([
config.nodeName,
Expand Down Expand Up @@ -531,7 +534,9 @@ export const getSurgeNodes = (
configString.push(...config.hostnameIp.map(item => `addresses = ${item}`));
}

configString.push(`addresses = ${config.hostname}`);
if (isIp(config.hostname)) {
configString.push(`addresses = ${config.hostname}`);
}

// istanbul ignore next
if (process.env.NODE_ENV !== 'test') {
Expand Down

0 comments on commit f7006d6

Please sign in to comment.