package ip2proxy

  1. Overview
  2. Docs
IP2Proxy OCaml module to get proxy data

Install

Dune Dependency

Authors

Maintainers

Sources

v3.1.0.tar.gz
md5=5e6aa833eaf784d9d5aa6c69e158d2ab
sha512=6e6535bdcfac7e51b39eac3c9a24ad9c578658c271554f062d403a5d12ad38cb5fbde964333f0e8d67ca30612233d8b45e7db15ac34507b49f4c97d42e2dba4d

Description

IP2Proxy OCaml module enables user to query an IP address if it was being used as VPN anonymizer, open proxies, web proxies, Tor exits, data center, web hosting (DCH) range, search engine robots (SES), residential proxies (RES), consumer privacy networks (CPN), and enterprise private networks (EPN).

Tags

ip2proxy proxy

Published: 27 Feb 2025

README

IP2Proxy OCaml Module

This OCaml module allows user to query an IP address if it was being used as VPN anonymizer, open proxies, web proxies, Tor exits, data center, web hosting (DCH) range, search engine robots (SES), residential proxies (RES), consumer privacy networks (CPN), and enterprise private networks (EPN). It supports both IP address in IPv4 and IPv6.

Compilation

dune build

QUERY USING THE BIN FILE

Dependencies

This module requires IP2Proxy BIN data file to function. You may download the BIN data file at

  • IP2Proxy LITE BIN Data (Free): https://lite.ip2location.com

  • IP2Proxy Commercial BIN Data (Comprehensive): https://www.ip2location.com

Methods

Below are the methods supported in this module.

Method Name Description
open_db Initialize with the BIN file.
query Returns the proxy information.
close_db Closes BIN file.

Usage

open Printf
open Ip2proxy

(* query IP2Proxy BIN datababase *)
let meta = Database.open_db "/path_to_your_database_file/your_BIN_file.BIN";;

let ip = "8.8.8.8";;
let res = Database.query meta ip;;

printf "country_short: %s\n" res.country_short;;
printf "country_long: %s\n" res.country_long;;
printf "region: %s\n" res.region;;
printf "city: %s\n" res.city;;
printf "isp: %s\n" res.isp;;
printf "proxy_type: %s\n" res.proxy_type;;
printf "is_proxy: %d\n" res.is_proxy;;
printf "domain: %s\n" res.domain;;
printf "usage_type: %s\n" res.usage_type;;
printf "asn: %s\n" res.asn;;
printf "as: %s\n" res.asys;;
printf "last_seen: %d\n" res.last_seen;;
printf "threat: %s\n" res.threat;;
printf "provider: %s\n" res.provider;;
printf "fraud_score: %s\n" res.fraud_score;;

Database.close_db meta;;

Dependencies (4)

  1. ipaddr >= "4.0.0"
  2. stdint
  3. dune >= "3.4"
  4. ocaml >= "4.08"

Dev Dependencies (1)

  1. odoc with-doc

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.