Socket
Socket
Sign inDemoInstall

ip-accesscontrol

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ip-accesscontrol

Used to check whether an IP address is in the IP whitelist. Supports IP pattern, IP range ...


Version published
Weekly downloads
22
decreased by-56.86%
Maintainers
1
Install size
4.93 kB
Created
Weekly downloads
 

Readme

Source

Welcome to IP ACCESS CONTROL!

Used to check whether an IP address is in the IP whitelist. Supports IP pattern, IP range ...

Install

npm install ip-accesscontrol

Using

Supports the format of the pattern:

  • Simple IP: 192.168.0.1 219.214.222.34
    • character support is for all. 192.168. * // allows all IPs with prefixes of 192.168 169
  • IP range support: 192.168.1.0-100 // allow the IPs from 192.168.1.0 to 192.168.100 192.168-169. * // allow IPs from 192.168.xxx.xxx to 192.169.xxx.xxx

More: 192. * 192.0-199.2-8. *

in js file:

	import IPAccessControl from 'ip-accesscontrol'
	......
	let pattern = "192.168.*"
	IPAccessControl.check("192.168.20.1", pattern) //true
	IPAccessControl.check("192.168.254.19", pattern) //true

	IPAccessControl.check("192.39.13.6", pattern) //false

	let arrayPattern = ["192.*", "169.0-1.10"]
	IPAccessControl.check("192.168.20.1", arrayPattern) //true
	IPAccessControl.check("169.0.10.1", arrayPattern) //true
	IPAccessControl.check("169.1.10.1", arrayPattern) //true
	IPAccessControl.check("169.1.20.1", arrayPattern) //false

NgocHip

FAQs

Last updated on 04 Oct 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc