load-ip-set

WebJar for load-ip-set

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

load-ip-set
Last Version

Last Version

2.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

load-ip-set
WebJar for load-ip-set
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/webtorrent/load-ip-set

Download load-ip-set

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/load-ip-set/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>load-ip-set</artifactId>
    <version>2.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/load-ip-set/
implementation 'org.webjars.npm:load-ip-set:2.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/load-ip-set/
implementation ("org.webjars.npm:load-ip-set:2.1.0")
'org.webjars.npm:load-ip-set:jar:2.1.0'
<dependency org="org.webjars.npm" name="load-ip-set" rev="2.1.0">
  <artifact name="load-ip-set" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='load-ip-set', version='2.1.0')
)
libraryDependencies += "org.webjars.npm" % "load-ip-set" % "2.1.0"
[org.webjars.npm/load-ip-set "2.1.0"]

Dependencies

compile (5)

Group / Artifact Type Version
org.webjars.npm : ip-set jar [1.0.0,2)
org.webjars.npm : netmask jar [1.0.6,2)
org.webjars.npm : split jar [1.0.0,2)
org.webjars.npm : simple-get jar [3.0.0,4)
org.webjars.npm : once jar [1.3.0,2)

Project Modules

There are no modules declared in this project.

load-ip-set travis npm downloads javascript style guide

download and parse ip-set (blocklist) files

This module is used by WebTorrent!

Install

npm install load-ip-set

Usage

Given one of the following:

  • http/https url (gzip, deflate, or no compression)
  • filesystem path (gzip, or no compression)
  • array of ip addresses or { start: '1.2.3.0', end: '1.2.3.255' } ip ranges

this module loads the ip set (downloading from the network, if necessary) and returns an ip-set object. An ip-set is just a mutable set data structure optimized for use with IPv4 and IPv6 addresses.

const loadIPSet = require('load-ip-set')
loadIPSet('http://example.com/list.txt', (err, ipSet) => {
  if (err) throw err
  ipSet.contains('1.2.3.4') //=> true
  ipSet.contains('2.2.2.2') //=> false
})

The second argument can be an optional opts object which will be passed to simple-get and the node.js core http.request method. This is useful for setting the user agent, for example.

loadIPSet('http://example.com/list.txt', {
  headers: {
    'user-agent': 'WebTorrent (http://webtorrent.io)'
  }
}, (err, ipSet) => {

})

License

MIT. Copyright (c) Feross Aboukhadijeh and WebTorrent, LLC.

org.webjars.npm

WebTorrent

⚡️⚡️⚡️ Streaming torrent client for the web, Node.js, Mac, Windows, & Linux.

Versions

Version
2.1.0