mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-31 06:03:06 +02:00
fix(tcp): wrap proxy proto listener before acl
This commit is contained in:
@@ -53,17 +53,17 @@ func (s *TCPTCPStream) ListenAndServe(ctx context.Context, preDial, onRead netty
|
||||
|
||||
// TODO: add to entrypoint
|
||||
|
||||
if acl := acl.FromCtx(ctx); acl != nil {
|
||||
log.Debug().Str("listener", s.listener.Addr().String()).Msg("wrapping listener with ACL")
|
||||
s.listener = acl.WrapTCP(s.listener)
|
||||
}
|
||||
|
||||
if ep := entrypoint.FromCtx(ctx); ep != nil {
|
||||
if proxyProto := ep.SupportProxyProtocol(); proxyProto {
|
||||
s.listener = &proxyproto.Listener{Listener: s.listener}
|
||||
}
|
||||
}
|
||||
|
||||
if acl := acl.FromCtx(ctx); acl != nil {
|
||||
log.Debug().Str("listener", s.listener.Addr().String()).Msg("wrapping listener with ACL")
|
||||
s.listener = acl.WrapTCP(s.listener)
|
||||
}
|
||||
|
||||
s.preDial = preDial
|
||||
s.onRead = onRead
|
||||
go s.listen(ctx)
|
||||
|
||||
Reference in New Issue
Block a user