@gibme/iptables
    Preparing search index...

    Class IPTables

    Hierarchy

    • EventEmitter
      • IPTables
    Index

    Constructors

    • Constructs a new instance of the helper/wrapper

      Parameters

      Returns IPTables

    Properties

    options: Options

    Methods

    • Protected

      Adds a jump statement for the specified IP address to the IPTables chain

      Parameters

      • host: string
      • jumpTarget: string = 'ACCEPT'
      • nothrow: boolean = false

      Returns Promise<void>

    • Adds a jump statement for the specified interface to the IPTables chain

      Parameters

      • iface: string
      • jumpTarget: string = 'ACCEPT'
      • nothrow: boolean = false

      Returns Promise<void>

    • Adds a jump statement for the specified IP address to the IPTables chain

      Parameters

      • host: string
      • jumpTarget: string = 'ACCEPT'

      Returns Promise<boolean>

    • Adds a jump statement for the specified interface to the IPTables chain

      Parameters

      • iface: string
      • jumpTarget: string = 'ACCEPT'

      Returns Promise<boolean>

    • Deletes the specified IP address from the IPTable chain

      Parameters

      • host: string

      Returns Promise<boolean>

    • Deletes the specified interface from the IPTable chain

      Parameters

      • iface: string

      Returns Promise<boolean>

    • Flushes the IPTables chain

      Parameters

      • nothrow: boolean = false

      Returns Promise<void>

    • Flushes the IPTables chain and clears our knowledge of all known entries

      Returns Promise<void>

    • Bumps the keep alive time for the specified IP address in the list of known entries

      Parameters

      • host: string

      Returns Promise<void>

    • Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.

      server.on('connection', (stream) => {
      console.log('someone connected!');
      });

      Returns a reference to the EventEmitter, so that calls can be chained.

      By default, event listeners are invoked in the order they are added. The emitter.prependListener() method can be used as an alternative to add the event listener to the beginning of the listeners array.

      import { EventEmitter } from 'node:events';
      const myEE = new EventEmitter();
      myEE.on('foo', () => console.log('a'));
      myEE.prependListener('foo', () => console.log('b'));
      myEE.emit('foo');
      // Prints:
      // b
      // a

      Parameters

      • event: "error"
      • listener: (error: Error) => void

        The callback function

      Returns this

      v0.1.101

    • Parameters

      • event: "expired"
      • listener: (key: any) => void

      Returns this

    • Protected

      Rebuilds the IPTables change from the cache

      Returns Promise<boolean>