1.6 KiB
Node UFW Docs
.allow.port(port: number, protocol?: "udp" | "tcp")
Allow incoming requests through specific port.
await nodeUfw.allow.port(6379);
nodeUfw.allow.port(6379, "udp");
returns
Promise<Boolean>
.allow.address(address: string, port?: number, protocol?: "udp" | "tcp")
Allow incoming requests through specific (IP) address.
await nodeUfw.allow.address("192.168.0.1");
nodeUfw.allow.address("192.168.0.1", 6379);
returns
Promise<Boolean>
.deny.port(port: number, protocol?: "udp" | "tcp")
Deny incoming requests through specific port.
await nodeUfw.deny.port(6379);
nodeUfw.deny.port(6379, "udp");
returns
Promise<Boolean>
.deny.address(address: string, port?: number, protocol?: "udp" | "tcp")
Deny incoming requests through specific (IP) address.
await nodeUfw.deny.address("192.168.0.1");
nodeUfw.deny.address("192.168.0.1", 6379);
returns
Promise<Boolean>
.delete(num: number)
Delete ufw rule. The number rule starts from number 1. See sudo ufw status numbered
for more information.
returns
Promise<Boolean>
.disable()
Disable UFW.
returns
Promise<Boolean>
.enable()
Enable UFW.
returns
Promise<Boolean>
.reload()
Reloads firewall.
returns
Promise<Boolean>
.reset()
Disables and resets firewall to installation defaults. No prompt. Use this wisely.
returns
Promise<Boolean>
.status(raw?: boolean)
List of currently activated UFW.
returns
Promise<string | {to: string, action: string, from: string }[]>
.logging(type: "off" | "on" | "low" | "medium" | "high" | "full")
Set/toggle UFW logging.
returns
Promise<Boolean>