Add support proxyprotocol v2

This commit is contained in:
Fedorenko Dmitrij 2019-08-26 15:40:04 +03:00 committed by Traefiker Bot
parent 4ec90c5c0d
commit e1831c4c60
6 changed files with 78 additions and 16 deletions

View file

@ -8,7 +8,7 @@ import (
"sync"
"time"
"github.com/armon/go-proxyproto"
proxyprotocol "github.com/c0va23/go-proxyprotocol"
"github.com/containous/traefik/v2/pkg/config/static"
"github.com/containous/traefik/v2/pkg/ip"
"github.com/containous/traefik/v2/pkg/log"
@ -240,10 +240,9 @@ func buildProxyProtocolListener(ctx context.Context, entryPoint *static.EntryPoi
log.FromContext(ctx).Infof("Enabling ProxyProtocol for trusted IPs %v", entryPoint.ProxyProtocol.TrustedIPs)
return &proxyproto.Listener{
Listener: listener,
SourceCheck: sourceCheck,
}, nil
return proxyprotocol.NewDefaultListener(listener).
WithSourceChecker(sourceCheck).
WithLogger(log.FromContext(ctx)), nil
}
func buildListener(ctx context.Context, entryPoint *static.EntryPoint) (net.Listener, error) {