From 91a19aa88118ae6baaff753133061052e7c35d4d Mon Sep 17 00:00:00 2001 From: dingjun Date: Sat, 13 Apr 2019 16:59:29 +0800 Subject: [PATCH] add New function --- proxy_protocol.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proxy_protocol.go b/proxy_protocol.go index 9c1b2b6..ef3bf0a 100644 --- a/proxy_protocol.go +++ b/proxy_protocol.go @@ -18,6 +18,11 @@ type protoConn struct { proxy *proxyproto.Header } +// New create a wrapped listener +func New(l net.Listener) net.Listener { + return &protoListener{l} +} + func (l *protoListener) Accept() (net.Conn, error) { c, err := l.Listener.Accept() if err != nil {