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:
Nathan Caza
2017-03-09 23:31:37 -06:00
committed by Matt Holt
parent c62b6b9f1a
commit 9e4eeb4fb7
4 changed files with 34 additions and 5 deletions
+6
View File
@@ -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.
//