Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: private ip ts compile has no call signatures #1020

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/nat-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const log = Object.assign(debug('libp2p:nat'), {
})
const { isBrowser } = require('wherearewe')
const retry = require('p-retry')
// @ts-ignore private-api does not export types
const isPrivateIp = require('private-ip')
const pkg = require('../package.json')
const errcode = require('err-code')
Expand Down Expand Up @@ -115,6 +114,7 @@ class NatManager {
const client = this._getClient()
const publicIp = this._externalIp || await client.externalIp()

// @ts-ignore isPrivate has no call signatures
if (isPrivateIp(publicIp)) {
throw new Error(`${publicIp} is private - please set config.nat.externalIp to an externally routable IP or ensure you are not behind a double NAT`)
}
Expand Down