Coder Social home page Coder Social logo

load-ip-set's Introduction

load-ip-set ci 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.

import loadIPSet from '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.

load-ip-set's People

Contributors

alxhotel avatar diegorbaquero avatar feross avatar greenkeeper[bot] avatar greenkeeperio-bot avatar jotadepicas avatar renovate-bot avatar renovate[bot] avatar semantic-release-bot avatar thaunknown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

load-ip-set's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v3
  • actions/setup-node v3
.github/workflows/release.yml
  • actions/checkout v3
  • actions/setup-node v3
  • actions/cache v3
npm
package.json
  • cross-fetch-ponyfill ^1.0.1
  • ip-set ^2.1.0
  • netmask ^2.0.1
  • once ^1.4.0
  • queue-microtask ^1.2.3
  • split ^1.0.1
  • @webtorrent/semantic-release-config 1.0.10
  • semantic-release 21.1.2
  • standard *
  • tape 5.7.5

  • Check this box to trigger a request for Renovate to run again on this repository

An in-range update of standard is breaking the build 🚨

The devDependency standard was updated from 13.0.0 to 13.0.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

standard is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of standard is breaking the build 🚨

Version 12.0.0 of standard was just published.

Branch Build failing 🚨
Dependency standard
Current Version 11.0.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

standard is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 91 commits.

  • ff1a156 authors
  • 17727fc 12.0.0
  • bdbd248 changelog
  • 3db3a62 https
  • cf1802c eslint-plugin-standard ~4.0.0
  • 7d779b8 eslint-plugin-import ~2.14.0
  • 66f676b eslint ~5.4.0
  • 3933c6b Use npm versions of eslint shared configs
  • c00dc66 Use ~ for eslint dep
  • 588d5ab Add links to French README translation!
  • aee57b4 ESLint 5
  • c89d5c7 Merge pull request #1145 from theo4u/patch-1
  • 6477dbf Merge pull request #1184 from standard/greenkeeper/babel-eslint-9.0.0
  • 8792b9b Merge pull request #1180 from standard/greenkeeper/eslint-plugin-promise-4.0.0
  • ff070b8 Merge branch 'master' into greenkeeper/eslint-plugin-promise-4.0.0

There are 91 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Normalized ipset format is not parsed correctly?

Hi,
I started using load-ip-set but it seems that if your ipset file is just a list of IP addresses, one per line (and not in the form "description:fromIP-toIP", just one IP per line, no description, no from-to range, etc) it is not recognized by your regex.

I am using https://github.com/firehol/blocklist-ipsets and for example, zeus_badips is in this format.

Am I doing something wrong or is this expected? If I cannot parse files with just IPs on them, I would have to go directly to ip-set like you did, but I would rather use your wrapper module instead.

thanks!

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Once you have installed CI on this repository, you’ll need to re-trigger Greenkeeper’s initial Pull Request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.