bunny

package module
v0.0.0-...-2e5e90e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

Bunny.net Edge IP source module for Caddy

Retrieves Bunny.net Edge IPs for use in Caddy trusted_proxies directives.

Go report GoDoc License Code with hearth by Stnby

Caddy module name

http.ip_sources.bunny

Config example

Put following config in global options under corresponding server options:

trusted_proxies bunny {
    interval 12h
    timeout 15s
}

License

This project is licensed under the Apache License, Version 2.0 - see the LICENSE.txt file for details.

This project is based on caddy-cloudflare-ip module. Thanks WeidiDeng for your hard work.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BunnyIPRange

type BunnyIPRange struct {
	// refresh Interval
	Interval caddy.Duration `json:"interval,omitempty"`
	// request Timeout
	Timeout caddy.Duration `json:"timeout,omitempty"`
	// contains filtered or unexported fields
}

BunnyIPRange provides a range of IP address prefixes (CIDRs) retrieved from https://api.bunny.net/system/edgeserverlist and https://api.bunny.net/system/edgeserverlist/ipv6.

func (BunnyIPRange) CaddyModule

func (BunnyIPRange) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*BunnyIPRange) GetIPRanges

func (s *BunnyIPRange) GetIPRanges(_ *http.Request) []netip.Prefix

func (*BunnyIPRange) Provision

func (s *BunnyIPRange) Provision(ctx caddy.Context) error

func (*BunnyIPRange) UnmarshalCaddyfile

func (m *BunnyIPRange) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile implements caddyfile.Unmarshaler.

bunny {
   interval val
   timeout val
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL