BlockList

external class BlockList(source)

The BlockList object can be used with some network APIs to specify rules for disabling inbound or outbound access to specific IP addresses, IP ranges, or IP subnets.

Since

v15.0.0, v14.18.0

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The list of rules added to the blocklist.

Functions

Link copied to clipboard

fun addAddress(address: String, type: IPVersion = definedExternally)

Adds a rule to block the given IP address.

Link copied to clipboard

fun addRange(start: String, end: String, type: IPVersion = definedExternally)

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

Link copied to clipboard
fun addSubnet(net: SocketAddress, prefix: Number)

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

fun addSubnet(net: String, prefix: Number, type: IPVersion = definedExternally)
Link copied to clipboard
fun check(address: SocketAddress): Boolean

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

fun check(address: String, type: IPVersion = definedExternally): Boolean