mirror of
https://github.com/coredns/coredns.git
synced 2026-02-13 02:43:10 -05:00
feat(proxyproto): add proxy protocol support (#7738)
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/coredns/coredns/plugin/pkg/transport"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
"github.com/pires/go-proxyproto"
|
||||
)
|
||||
|
||||
// ServerTLS represents an instance of a TLS-over-DNS-server.
|
||||
@@ -79,6 +80,9 @@ func (s *ServerTLS) Listen() (net.Listener, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if s.connPolicy != nil {
|
||||
l = &proxyproto.Listener{Listener: l, ConnPolicy: s.connPolicy}
|
||||
}
|
||||
return l, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user