package ip2proxy

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

Install

Dune Dependency

Authors

Maintainers

Sources

v3.0.0.tar.gz
md5=9f98b5afc060d5bb9682fceb181f4c38
sha512=b6ba8d645b05c56ed88e7ff8d63ebea61b27b650b2908e40c430288b49825cadfdb9231b7891e50993a69351fd4130fd971a743d6a41da3a3fed394a7b6bc37c

README.md.html

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;;

Database.close_db meta;;

OCaml

Innovation. Community. Security.