geo302 is not an actual proxy, but a "pathfinder", which responses with 302 Found redirecting the HTTP-client to the actual URL.
We use geolite2 geoIP database to determine user's location and select the most suitable upstream for this location.
Client's IP is determined using proxy headers like X-FORWARDED-FOR with a fallback to the socket IP address.
geo302 performs active health checks against all upstreams pinging them every few seconds.
The main use case of geo302 is redirecting a user to the closest server to minimize download time of large files.
geo302.tomlcargo run --release -- ./geo302.tomlSee an example of the configuration in geo302.toml.
Here we present a configuration where the optional entries have the default values:
```toml
geolite2 = "
[mirrors]
somemirror = { upstream = "
[continents]
default = ["
```
geo302 is not a load-balancer. geo302 currently doesn't support an upstream rotation for a single location, but you can specify a list of upstreams: the first available location will be used.
If you need a load balancing to optimize a network usage, but do not need geoIP support, consider using another redirect proxy like rlb.
Locations are continent-level only. See https://github.com/hombit/geo302/issues/3 for country-level support
Only GET is supported. See https://github.com/hombit/geo302/issues/4 for HEAD support for health checks
All these limitations are not a part of the design and can be fixed in the future version. Feel free to open an issue or a PR.
MIT licensed.