Our great sponsors
-
go-geofence
A small library to detect if an IP address is close to yours or another of your choosing using https://ipbase.com
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
What did I do to solve this? I wrote a library called go-geofence that uses freegeoip.app behind these scenes (because the service gives you 15,000 request per hour for free).
Caddy is an awesome web server alternative to nginx and apache (httpd). Caddy is written in Go, is a much more performant and extensible web server (in my opinion). With Caddy, you can host basic files or reverse proxy your API's, which is how I use it. I use Caddy because of its automatic TLS functionality so I don't have to worry about manual creation of certificates and keys.
Since I'm using echo as the web framework to control my decorations, I was able to implement some pretty simple middleware that rejects POST requests from IP addresses that aren't within close proximity to mine with a 403 status code.
Since I'm using echo as the web framework to control my decorations, I was able to implement some pretty simple middleware that rejects POST requests from IP addresses that aren't within close proximity to mine with a 403 status code.
For more info on implementing a geofenced web server/reverse proxy with caddy, see the caddy-geofence repo
Caddy is an awesome web server alternative to nginx and apache (httpd). Caddy is written in Go, is a much more performant and extensible web server (in my opinion). With Caddy, you can host basic files or reverse proxy your API's, which is how I use it. I use Caddy because of its automatic TLS functionality so I don't have to worry about manual creation of certificates and keys.