MaddRange
Bun

method

net.BlockList.addRange

start: string,
end: string,
type?: IPVersion
): void;

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

@param start

The starting IPv4 or IPv6 address in the range.

@param end

The ending IPv4 or IPv6 address in the range.

@param type

Either 'ipv4' or 'ipv6'.

): void;

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

@param start

The starting IPv4 or IPv6 address in the range.

@param end

The ending IPv4 or IPv6 address in the range.

Referenced types

type IPVersion = 'ipv4' | 'ipv6'
  • readonly address: string

    Either 'ipv4' or 'ipv6'.

  • readonly family: IPVersion

    Either 'ipv4' or 'ipv6'.

  • readonly flowlabel: number
  • readonly port: number
  • static parse(
    input: string
    ): undefined | SocketAddress;
    @param input

    An input string containing an IP address and optional port, e.g. 123.1.2.3:1234 or [1::1]:1234.

    @returns

    Returns a SocketAddress if parsing was successful. Otherwise returns undefined.