| Author: | Thomas Lecomte |
|---|---|
| Date: | 2015-04-29 |
| Version: | 2 |
| Manual section: | 3 |
import ip2location;
Implements bindings to IP2Location from the Varnish VCL.
- Prototype
country_short(STRING ip)
- Return value
- STRING
- Description
- Returns the short country code determined from the IP.
- Example
set req.http.X-Country = ip2location.country_short("" + client.ip);
- Prototype
region(STRING ip)
- Return value
- STRING
- Description
- Returns the region/state code determined from the IP.
- Example
set req.http.X-Region = ip2location.region("" + client.ip);
This manual page was released as part of the libvmod-ip2location package. It is based on the excellent libvmod-example package provided by Varnish Software.