404

[ Avaa Bypassed ]




Upload:

Command:

botdev@18.116.21.127: ~ $
/**
 * Module dependencies.
 */

var dns = require('dns');
var Netmask = require('netmask').Netmask;

/**
 * Module exports.
 */

module.exports = isInNet;

isInNet.async = true;

/**
 * True iff the IP address of the host matches the specified IP address pattern.
 *
 * Pattern and mask specification is done the same way as for SOCKS configuration.
 *
 * Examples:
 *
 * ``` js
 * isInNet(host, "198.95.249.79", "255.255.255.255")
 *   // is true iff the IP address of host matches exactly 198.95.249.79.
 *
 * isInNet(host, "198.95.0.0", "255.255.0.0")
 *   // is true iff the IP address of the host matches 198.95.*.*.
 * ```
 *
 * @param {String} host a DNS hostname, or IP address. If a hostname is passed,
 *   it will be resoved into an IP address by this function.
 * @param {String} pattern an IP address pattern in the dot-separated format mask.
 * @param {String} mask for the IP address pattern informing which parts of the
 *   IP address should be matched against. 0 means ignore, 255 means match.
 * @return {Boolean}
 */

function isInNet (host, pattern, mask, fn) {
  var family = 4;
  dns.lookup(host, family, function (err, ip) {
    if (err) return fn(err);
    if (!ip) ip = '127.0.0.1';
    var netmask = new Netmask(pattern, mask);
    fn(null, netmask.contains(ip));
  });
}

Filemanager

Name Type Size Permission Actions
test Folder 0755
.npmignore File 61 B 0644
.travis.yml File 318 B 0644
CHANGELOG.md File 6.03 KB 0644
README.md File 3.04 KB 0644
dateRange.js File 2.28 KB 0644
dnsDomainIs.js File 699 B 0644
dnsDomainLevels.js File 561 B 0644
dnsResolve.js File 638 B 0644
index.js File 3.49 KB 0644
isInNet.js File 1.27 KB 0644
isPlainHostName.js File 439 B 0644
isResolvable.js File 425 B 0644
localHostOrDomainIs.js File 1.1 KB 0644
myIpAddress.js File 1.01 KB 0644
package.json File 2.48 KB 0644
shExpMatch.js File 997 B 0644
timeRange.js File 3.19 KB 0644
weekdayRange.js File 2.14 KB 0644