Skip to content

http.matchers.dynamic_client_ip matches requests by the client IP address, the ip addresses to match against is provided my a module that implements IPRangeSource

License

Notifications You must be signed in to change notification settings

tuzzmaniandevil/caddy-dynamic-clientip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic Client IP matcher for Caddy

Maintenance Go Reference GoReportCard example License

The dynamic_client_ip module is a clone of the client_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.

Installation

Build Caddy using xcaddy:

xcaddy build --with github.com/tuzzmaniandevil/caddy-dynamic-clientip

Usage

:8880 {
	@denied dynamic_client_ip my_dynamic_provider
	abort @denied

    reverse_proxy localhost:8080
}

Example using the built-in static provider (But why though?)

:8880 {
	@denied dynamic_client_ip static 12.34.56.0/24 1200:ab00::/32
	abort @denied

    reverse_proxy localhost:8080
}

Development

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 run

License

The project is licensed under the Apache License.

About

http.matchers.dynamic_client_ip matches requests by the client IP address, the ip addresses to match against is provided my a module that implements IPRangeSource

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Languages