root: add support for PROXY protocol on listeners
closes #1161 Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -4,6 +4,7 @@ import (
|
||||
"crypto/tls"
|
||||
"net"
|
||||
|
||||
"github.com/pires/go-proxyproto"
|
||||
"goauthentik.io/internal/config"
|
||||
"goauthentik.io/internal/crypto"
|
||||
)
|
||||
@ -27,7 +28,10 @@ func (ws *WebServer) listenTLS() {
|
||||
}
|
||||
ws.log.WithField("addr", config.G.Web.ListenTLS).Info("Running")
|
||||
|
||||
tlsListener := tls.NewListener(tcpKeepAliveListener{ln.(*net.TCPListener)}, tlsConfig)
|
||||
proxyListener := &proxyproto.Listener{Listener: tcpKeepAliveListener{ln.(*net.TCPListener)}}
|
||||
defer proxyListener.Close()
|
||||
|
||||
tlsListener := tls.NewListener(proxyListener, tlsConfig)
|
||||
ws.serve(tlsListener)
|
||||
ws.log.Printf("closing %s", tlsListener.Addr())
|
||||
}
|
||||
|
Reference in New Issue
Block a user