Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit 3916ca0

Browse files
author
ZeroWolf233
committed
fix: 同步93的修正ip.isPrivate
1 parent f82b6e1 commit 3916ca0

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/cluster.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ import type {TokenManager} from './token.js'
3939
import type {IFileList} from './types.js'
4040
import {setupUpnp} from './upnp.js'
4141
import {checkSign, hashToFilename} from './util.js'
42-
import pkg from 'ip';
43-
const { isPrivate } = pkg;
42+
import * as ipPkg from 'ip'
4443

4544
interface ICounters {
4645
hits: number
@@ -138,7 +137,7 @@ export class Cluster {
138137
if (config.enableUpnp) {
139138
await setupUpnp(config.port, config.clusterPublicPort)
140139
const ip = await setupUpnp(config.port, config.clusterPublicPort)
141-
if (isPrivate(ip)) {
140+
if (ipPkg.isPrivate(ip)) {
142141
throw new Error(`不对啊,你这IP(${ip})也不是公网IP啊`)
143142
}
144143
logger.info(`upnp映射成功,公网IP: ${ip}`)

0 commit comments

Comments
 (0)