feat(tcp): add TCP transmission protocol check

This commit is contained in:
Gouryella
2026-01-14 14:50:45 +08:00
parent 4b2dcc0ee1
commit b8d1002d35

View File

@@ -197,6 +197,14 @@ func (l *Listener) handleConnection(netConn net.Conn) {
l.connMu.Unlock()
})
// Check if TCP transport is allowed
if !l.IsTransportAllowed("tcp") {
l.logger.Warn("TCP transport not allowed, rejecting connection",
zap.String("remote_addr", netConn.RemoteAddr().String()),
)
return
}
tlsConn, ok := netConn.(*tls.Conn)
if !ok {
l.logger.Error("Connection is not TLS")