🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

ip-ban-list

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ip-ban-list

Shared IP ban list backed by Hyperbee2, seedable over Hyperswarm

latest
Source
npmnpm
Version
0.3.2
Version published
Maintainers
1
Created
Source

ip-ban-list

Shared IP ban list backed by Hyperbee2, seedable over Hyperswarm.

Install

npm install ip-ban-list

Usage

API

const banList = new IpBanList(store, [opts])

Create a new IP ban list.

  • store: Corestore instance
  • opts.key: Hypercore public key to open an existing ban list read-only (default: null)

await banList.ready()

Initialize the ban list.

await banList.close()

Close the ban list.

await banList.ban(ip)

Ban an IP address.

  • ip: IP address string (e.g. '1.2.3.4')

await banList.unban(ip)

Remove an IP address from the ban list.

  • ip: IP address string

const banned = banList.isBanned(ip)

Check if an IP address is banned. Returns true or false from an in-memory cache that is loaded on ready() and updated from Hyperbee.

banList.on('cache-updated')

Emitted when the in-memory cache is updated from Hyperbee. Fires once during ready() and after later local or replicated updates.

banList.on('cache-update-error', error)

Emitted when updating the in-memory cache from Hyperbee fails.

  • error: Error thrown while refreshing the cache

banList.key

The Hypercore public key for the ban list (32 bytes).

banList.discoveryKey

The discovery key for swarming (32 bytes).

License

Apache-2.0

Keywords

blind-peer

FAQs

Package last updated on 20 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts