mirror of
https://github.com/caddyserver/caddy.git
synced 2026-05-13 10:42:16 -04:00
Add proxyprotocol directive and listener middleware plugin type (#1349)
* add support for listener middleware * add proxyprotocol directive * make caddy.Listener interface required * Remove tcpKeepAliveListener wrapper from Serve() This is now done in the Listen() function, along with other potential middleware.
This commit is contained in:
@@ -6,6 +6,8 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
"time"
|
||||
|
||||
"github.com/mholt/caddy"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -18,6 +20,10 @@ type (
|
||||
// passed the next Handler in the chain.
|
||||
Middleware func(Handler) Handler
|
||||
|
||||
// ListenerMiddleware is similar to the Middleware type, except it
|
||||
// chains one net.Listener to the next.
|
||||
ListenerMiddleware func(caddy.Listener) caddy.Listener
|
||||
|
||||
// Handler is like http.Handler except ServeHTTP may return a status
|
||||
// code and/or error.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user