diff options
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | go.sum | 4 | ||||
-rw-r--r-- | internal/sshd/sshd.go | 6 |
3 files changed, 8 insertions, 4 deletions
@@ -8,7 +8,7 @@ require ( github.com/mattn/go-shellwords v1.0.11 github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a github.com/otiai10/copy v1.4.2 - github.com/pires/go-proxyproto v0.5.0 + github.com/pires/go-proxyproto v0.6.0 github.com/prometheus/client_golang v1.10.0 github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.0 @@ -505,8 +505,8 @@ github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0 github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= -github.com/pires/go-proxyproto v0.5.0 h1:A4Jv4ZCaV3AFJeGh5mGwkz4iuWUYMlQ7IoO/GTuSuLo= -github.com/pires/go-proxyproto v0.5.0/go.mod h1:Odh9VFOZJCf9G8cLW5o435Xf1J95Jw9Gw5rnCjcwzAY= +github.com/pires/go-proxyproto v0.6.0 h1:cLJUPnuQdiNf7P/wbeOKmM1khVdaMgTFDLj8h9ZrVYk= +github.com/pires/go-proxyproto v0.6.0/go.mod h1:Odh9VFOZJCf9G8cLW5o435Xf1J95Jw9Gw5rnCjcwzAY= github.com/pkg/errors v0.0.0-20170505043639-c605e284fe17/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= diff --git a/internal/sshd/sshd.go b/internal/sshd/sshd.go index 7f96bef..8b49712 100644 --- a/internal/sshd/sshd.go +++ b/internal/sshd/sshd.go @@ -29,6 +29,7 @@ const ( StatusReady StatusOnShutdown StatusClosed + ProxyHeaderTimeout = 90 * time.Second ) type Server struct { @@ -84,7 +85,10 @@ func (s *Server) listen() error { } if s.Config.Server.ProxyProtocol { - sshListener = &proxyproto.Listener{Listener: sshListener} + sshListener = &proxyproto.Listener{ + Listener: sshListener, + ReadHeaderTimeout: ProxyHeaderTimeout, + } log.Info("Proxy protocol is enabled") } |