BlockList

@JSImport("net", "BlockList") @native @JSType class BlockList() extends StObject
trait StObject
class Object
trait Any
class Object
trait Matchable
class Any
class BlockList

Value members

Concrete methods

def addAddress(address: SocketAddress): Unit
def addAddress(address: String): Unit

Adds a rule to block the given IP address.

Adds a rule to block the given IP address.

Value Params
address

An IPv4 or IPv6 address.

type

Either 'ipv4' or 'ipv6'. Default: 'ipv4'.

def addAddress(address: String, `type`: IPVersion): Unit
def addRange(start: SocketAddress, end: SocketAddress): Unit
def addRange(start: String, end: String): Unit

Adds a rule to block a range of IP addresses from start (inclusive) to end (inclusive).

Adds a rule to block a range of IP addresses from start (inclusive) to end (inclusive).

Value Params
end

The ending IPv4 or IPv6 address in the range.

start

The starting IPv4 or IPv6 address in the range.

type

Either 'ipv4' or 'ipv6'. Default: 'ipv4'.

def addRange(start: String, end: String, `type`: IPVersion): Unit
def addSubnet(net: SocketAddress, prefix: Double): Unit

Adds a rule to block a range of IP addresses specified as a subnet mask.

Adds a rule to block a range of IP addresses specified as a subnet mask.

Value Params
net

The network IPv4 or IPv6 address.

prefix

The number of CIDR prefix bits. For IPv4, this must be a value between 0 and 32. For IPv6, this must be between 0 and 128.

type

Either 'ipv4' or 'ipv6'. Default: 'ipv4'.

def addSubnet(net: String, prefix: Double): Unit
def addSubnet(net: String, prefix: Double, `type`: IPVersion): Unit
def check(address: SocketAddress): Boolean

Returns true if the given IP address matches any of the rules added to the BlockList.

Returns true if the given IP address matches any of the rules added to the BlockList.

Value Params
address

The IP address to check

type

Either 'ipv4' or 'ipv6'. Default: 'ipv4'.

def check(address: String): Boolean
def check(address: String, `type`: IPVersion): Boolean

Inherited methods

def hasOwnProperty(v: String): Boolean
Inherited from
Object
def isPrototypeOf(v: Object): Boolean
Inherited from
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from
Object
def toLocaleString(): String
Inherited from
Object
def valueOf(): Any
Inherited from
Object