The dynamic_remote_ip module is a clone of the remote_ip matcher with one key difference: instead of providing IP ranges upfront, you specify an IPRangeSource. This allows IP ranges to be dynamically loaded per request.
This module is based on the caddy-dynamic-clientip module by tuzzmaniandevil.
Build Caddy using xcaddy:
xcaddy build --with github.com/lanrat/caddy-dynamic-remoteip:8880 {
@denied dynamic_remote_ip my_dynamic_provider
abort @denied
reverse_proxy localhost:8080
}Example using the built-in static provider (But why though?)
:8880 {
@denied dynamic_remote_ip static 12.34.56.0/24 1200:ab00::/32
abort @denied
reverse_proxy localhost:8080
}Before diving into development, make sure to follow the Extending Caddy guide. This ensures you're familiar with the Caddy development process and that your environment is set up correctly.
To run Caddy with this module:
xcaddy runThe project is licensed under the Apache License.