ip-devicer
    Preparing search index...

    Class ProxyEnricher

    Classifies IPs as Tor, VPN, proxy, hosting, or AI-agent traffic.

    Detection blends maintained CIDR lists with optional RDAP lookups so the classifier can fall back to registrant-name heuristics when an address is not covered by the bundled IPv4 ranges.

    Index

    Constructors

    • Parameters

      • torExitListUrl: string = DEFAULT_TOR_URL

        URL used to refresh the Tor exit-node list.

      • proxyListPaths: string[] = []

        Optional local CIDR files appended to the built-in VPN/proxy ranges.

      • hasLicense: boolean = false

        Whether paid-tier list loading should be enabled.

      • enableRdap: boolean = true

        Whether RDAP lookups may be used as a fallback classifier.

      Returns ProxyEnricher

    Methods

    • Run the full IP classification pass and return all derived flags together.

      RDAP is looked up once and shared across VPN/proxy/hosting heuristics.

      Parameters

      • ip: string

      Returns Promise<
          {
              agentInfo: AgentInfo;
              isHosting: boolean;
              isProxy: boolean;
              isTor: boolean;
              isVpn: boolean;
              rdapInfo: { asn?: number; asnOrg?: string };
          },
      >

    • Query ARIN RDAP (falling back to RIPE on 404) to look up the registered network name and origin ASN for a given IPv4 address.

      Returns {} for IPv6 addresses and on any network/parse failure so that callers can always destructure the result safely.

      Parameters

      • ip: string

      Returns Promise<{ asn?: number; asnOrg?: string }>

    • Fetch the Tor exit-node list and any licensed local CIDR files once.

      Initialization is best-effort: failed downloads or unreadable files do not throw.

      Returns Promise<void>

    • Classify whether the IP belongs to a known AI-agent range.

      Returns the matched provider plus a numeric confidence score when a catalog range applies, otherwise { isAiAgent: false }.

      Parameters

      • ip: string

      Returns AgentInfo

    • Classify an IP as datacenter or hosting-provider traffic.

      Checks known hosting CIDRs first, then optionally falls back to RDAP organization-name heuristics.

      Parameters

      • ip: string
      • OptionalrdapInfo: { asn?: number; asnOrg?: string }

      Returns Promise<boolean>

    • Classify an IP as proxy traffic.

      Checks the bundled/license-supplied CIDR lists first, then optionally falls back to RDAP organization-name heuristics.

      Parameters

      • ip: string
      • OptionalrdapInfo: { asn?: number; asnOrg?: string }

      Returns Promise<boolean>

    • Classify an IP as VPN traffic.

      Checks the bundled/license-supplied CIDR lists first, then optionally falls back to RDAP organization-name heuristics.

      Parameters

      • ip: string
      • OptionalrdapInfo: { asn?: number; asnOrg?: string }

      Returns Promise<boolean>