// Match returns true if the connection is from one of the designated IP ranges.
Match returns true if the connection is from one of the designated IP ranges.
// Match returns true if the connection is from one of the designated IP ranges .
func (m MatchIP) Match(cx *Connection) (bool, error) {
	clientIP, err := m.getClientIP(cx)
	if err != nil {
		return false, fmt.Errorf("getting client IP: %v", err)
	}
	for _, ipRange := range m.cidrs {
		if ipRange.Contains(clientIP) {
			return true, nil
		}
	}
	return false, nil
}
func ( m MatchIP ) Match ( cx * Connection ) ( bool , error ) { clientIP , err := m . getClientIP ( cx ) if err != nil { return false , fmt . Errorf ( " " , err ) } for _ , ipRange := range m . cidrs { if ipRange . Contains ( clientIP ) { return true , nil } } return false , nil }
Match returns true if the connection is from one of the designated IP ranges.
Match returns true if the connection is from one of the designated IP ranges .