Skip to content

Commit 1ba779f

Browse files
don't allow by default
1 parent 3939c24 commit 1ba779f

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The default timeout is `5s`. Set to `0` or `none` to disable the timeout.
1717

1818
```
1919
# Enable from any source (probably don't want this in prod)
20-
proxyprotocol
20+
proxyprotocol 0.0.0.0/0 ::/0
2121
2222
# Enable from local subnet and fixed IP
2323
proxyprotocol 10.22.0.0/16 10.23.0.1/32

listeners.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ func (l *Listener) Accept() (net.Conn, error) {
4444
return c, nil
4545
}
4646
for _, cfg := range l.Configs {
47-
if cfg.Subnets == nil {
48-
return proxyproto.NewConn(c, cfg.Timeout), nil
49-
}
5047
for _, s := range cfg.Subnets {
5148
if s.Contains(addr.IP) {
5249
return proxyproto.NewConn(c, cfg.Timeout), nil

setup.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ func setup(c *caddy.Controller) error {
4848
return c.ArgErr()
4949
}
5050
}
51+
if cfg.Subnets == nil {
52+
continue
53+
}
5154
configs = append(configs, cfg)
5255
if c.NextBlock() {
5356
return c.ArgErr()

0 commit comments

Comments
 (0)