<commit_before># ipfilter
ipfilter is a middleware for [Caddy](http://caddyserver.com)

# Caddyfile examples

#### filter clients based on a giving IP or range of IPs
```
ipfilter / {
	rule block
	ip 192.168.127.12-100 192.168.127.12-50 172.16.31.10
}
```
`caddy` will block any clients with IPs that fall into one of these two ranges `192.168.127.12-100`, `192.168.127.12-50` , or a client that has an IP of `172.16.31.10` explicitly, ranges are inclusive, which means `192.168.127.12` will get blocked.

```
ipfilter / {
	rule allow
	blockpage default.html
	ip 172.16.58.3 172.16.58.3
}<commit_msg>alter the example to include open ranges<commit_after># ipfilter
ipfilter is a middleware for [Caddy](http://caddyserver.com)

# Caddyfile examples

#### filter clients based on a giving IP or range of IPs
```
ipfilter / {
	rule block
	ip 192.168 192.168.127.12-50 172.16.31.10
}
```
`caddy` will block any clients with IPs that fall into one of these two ranges `192.168.0.0` to `192.168.255.255` and `192.168.127.12` to `192.168.3.11` , or a client that has an IP of `172.16.31.10` explicitly, ranges are inclusive, which means `192.168.3.11` will get blocked.

```
ipfilter / {
	rule allow
	blockpage default.html
	ip 55.3.4.20 172.16.58.3
}
{'fraction_non_alphanumeric': 0.1302250803858521, 'fraction_numerical': 0.159967845659164, 'mean_word_length': 3.5940959409594098, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 19, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3883731', 'n_tokens_mistral': 580, 'n_tokens_neox': 448, 'n_words': 155}