ip2location facebbook  ip2location twitter  ip2location google+ ip2location github

C Library

IP2Proxy C library enables the user to find the IP addresses which are used as VPN anonymizer, open proxies, web proxies and Tor exits. It has been optimized for speed and memory utilization. Developers can use the API to query all IP2Proxy™ binary databases for applications written in C or supporting static/dynamic library.

Download Download   Source Source

 

Installation

Unix/Linux

  1. Decompress the archive.
    tar xvfz ip2proxy-c-x.x.x.tar.gz
  2. Navigate to working directory.
    cd ip2proxy-c-x.x.x
  3. autoreconf -i -v --force
  4. ./configure
  5. make
  6. To test it, go to test folder.
    cd test
  7. And run the sample application
    test-IP2Proxy

 

Windows

  1. Decompress the archive.
  2. Open command prompt and navigate to Microsoft Visual Studio Visual C directory and execute vcvarsall.bat or vcvars32.bat. (Alternatively, open Visual Studio Command Prompt located in the start menu under Microsoft Visual Studio\Visual Studio Tools)
  3. Navigate to working directory.
    cd ip2proxy-c-x.x.x
  4. nmake Makefile.win
  5. To test it, go to test folder.
    cd test
  6. And run the sample application
    test-IP2Proxy

 

MacOS

  1. Decompress the archive.
  2. Navigate to working directory.
    cd ip2proxy-c-x.x.x
  3. autoreconf -i -v --force
  4. export CFLAGS=-I/usr/include/malloc
  5. ./configure
  6. make
  7. To test it, go to test folder.
    cd test
  8. And run the sample application
    test-IP2Proxy

 

Sample Codes
#include "IP2Proxy.h"

IP2Proxy *IP2ProxyObj = IP2Proxy_open("../data/IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP.SAMPLE.BIN");
IP2ProxyRecord *record = IP2Proxy_get_all(IP2ProxyObj, "161.11.12.13");
printf("%s %s %s %s %s %f %f %s %s %s %s %s %s %s %s %s %s %s %s %s\n",
   record->country_short,
   record->country_long,
   record->region,
   record->city,
   record->isp,
   record->is_proxy,
   record->proxy_type);
IP2Proxy_free_record(record);
IP2Proxy_close(IP2ProxyObj);

 

IP2Proxy LITE BIN Database

Developers may subscribe the free IP2Proxy LITE BIN database for testing and evaluation purpose. Please take note that the LITE database is limited to public proxies (PUB) IP address. Commercial databases consist of other proxy types such as Tor, VPN and etcs.