Categorygithub.com/sattvikc/caddy2-proxyprotocol
modulepackage
0.0.2
Repository: https://github.com/sattvikc/caddy2-proxyprotocol.git
Documentation: pkg.go.dev

# README

Add PROXY protocol support to Caddy 2

proxy_protocol is a listener wrapper for Caddy 2 that adds support for PROXY headers on new connections.

Configuration

Options

NameTypeDefaultDescription
timeoutduration5sSpecifies the maximum time for the PROXY header to be received. If zero, timeout is disabled.
allow[]string0.0.0.0\0A list of CIDR ranges to allow/require PROXY headers from.

JSON

The wrapper needs to be loaded BEFORE the tls wrapper.

{
  "apps": {
    "http": {
      "servers": {
        "myserver": {
          // ...
          "listener_wrappers":[
            {"wrapper": "proxy_protocol", "timeout": "5s", "allow": ["192.168.86/24"]},
            {"wrapper":"tls"}
          ]
          // ...
        }
      }
    }
  }
}

# Structs

Wrapper provides PROXY protocol support to Caddy by implementing the caddy.ListenerWrapper interface.