// Handle handles the connections.
Handle handles the connections.
// Handle handles the connections .
func (h *Handler) Handle(cx *layer4.Connection, next layer4.Handler) error {
	conn := h.newConn(cx)
	if conn == nil {
		h.logger.Debug("untrusted party not allowed",
			zap.String("remote", cx.RemoteAddr().String()),
			zap.Strings("allow", h.Allow),
		)
		return next.Handle(cx)
	}
	if _, err := conn.ProxyHeader(); err != nil {
		return fmt.Errorf("parsing the PROXY header: %v", err)
	}
	h.logger.Debug("received the PROXY header",
		zap.String("remote", conn.RemoteAddr().String()),
		zap.String("local", conn.LocalAddr().String()),
	)
	cx.SetVar("l4.proxy_protocol.conn", conn)
	return next.Handle(cx.Wrap(conn))
}
func ( h * Handler ) Handle ( cx * layer4 . Connection , next layer4 . Handler ) error { conn := h . newConn ( cx ) if conn == nil { h . logger . Debug ( " " , zap . String ( " " , cx . RemoteAddr ( ) . String ( ) ) , zap . Strings ( " " , h . Allow ) , ) return next . Handle ( cx ) } if _ , err := conn . ProxyHeader ( ) ; err != nil { return fmt . Errorf ( " " , err ) } h . logger . Debug ( " " , zap . String ( " " , conn . RemoteAddr ( ) . String ( ) ) , zap . String ( " " , conn . LocalAddr ( ) . String ( ) ) , ) cx . SetVar ( " " , conn ) return next . Handle ( cx . Wrap ( conn ) ) }
Handle handles the connections.
Handle handles the connections .
// Set conn as a custom variable on cx.