ip2location facebbook  ip2location twitter  ip2location google+ ip2location github

IP2Proxy Haskell Package

This Haskell package supports all IP2Proxy™ BIN database products to query proxy IP address and its country, region, city, ISP name and proxy types. It has been optimized for speed and memory utilization.

Hackage: https://hackage.haskell.org/package/ip2proxy GitHub Repository: https://github.com/ip2location/ip2proxy-haskell

 

Installation
    cabal install IP2Proxy
Sample Codes
import IP2Proxy

main :: IO ()
main = do
    let myfile = "IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP.BIN"
    let ip = "199.83.103.79"
    meta <- open myfile
    
    putStrLn $ "module_version: " ++ getModuleVersion
    putStrLn $ "package_version: " ++ (getPackageVersion meta)
    putStrLn $ "database_version: " ++ (getDatabaseVersion meta)
    
    result <- getAll myfile meta ip
    putStrLn $ "country_short: " ++ (show (country_short result))
    putStrLn $ "country_long: " ++ (show (country_long result))
    putStrLn $ "region: " ++ (show (region result))
    putStrLn $ "city: " ++ (show (city result))
    putStrLn $ "isp: " ++ (show (isp result))
    putStrLn $ "proxy_type: " ++ (show (proxy_type result))
    putStrLn $ "is_proxy: " ++ (show (is_proxy result))

    result <- getCountryShort myfile meta ip
    putStrLn $ "country_short: " ++ result
    result <- getCountryLong myfile meta ip
    putStrLn $ "country_long: " ++ result
    result <- getRegion myfile meta ip
    putStrLn $ "region: " ++ result
    result <- getCity myfile meta ip
    putStrLn $ "city: " ++ result
    result <- getISP myfile meta ip
    putStrLn $ "isp: " ++ result
    result <- getProxyType myfile meta ip
    putStrLn $ "proxy_type: " ++ result
    result <- isProxy myfile meta ip
    putStrLn $ "is_proxy: " ++ result

 

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.