---
title: NEURLFilterManager
framework: networkextension
role: symbol
role_heading: Class
path: networkextension/neurlfiltermanager
---

# NEURLFilterManager

A class you use to configure and control a URL filter.

## Declaration

```swift
class NEURLFilterManager
```

## Overview

Overview The system performs URL filtering on your behalf according to your configuration and URL data set. The system filters all URL requests initiated with the WebKit and URLSession APIs. During URL filtering, the system performs sub-URL generation to enumurate all possible sub-URLs for the URL in question. For example, the URL https://www.sub1.example.com/a/b/c?id=123#fragment parses into the following sub-URLs: example.com example.com/ example.com/a example.com/a/ example.com/a/b example.com/a/b/ example.com/a/b/c example.com/a/b/c/ example.com/a/b/c/?id=123 example.com/a/b/c/?id=123#fragment example.com/a/b/c?id=123 example.com/a/b/c?id=123#fragment example.com:443 example.com:443/ example.com:443/a example.com:443/a/ example.com:443/a/b example.com:443/a/b/ example.com:443/a/b/c example.com:443/a/b/c/ example.com:443/a/b/c/?id=123 example.com:443/a/b/c/?id=123#fragment example.com:443/a/b/c?id=123 example.com:443/a/b/c?id=123#fragment sub1.example.com sub1.example.com/ sub1.example.com/a sub1.example.com/a/ sub1.example.com/a/b sub1.example.com/a/b/ sub1.example.com/a/b/c sub1.example.com/a/b/c/ sub1.example.com/a/b/c/?id=123 sub1.example.com/a/b/c/?id=123#fragment sub1.example.com/a/b/c?id=123 sub1.example.com/a/b/c?id=123#fragment sub1.example.com:443 sub1.example.com:443/ sub1.example.com:443/a sub1.example.com:443/a/ sub1.example.com:443/a/b sub1.example.com:443/a/b/ sub1.example.com:443/a/b/c sub1.example.com:443/a/b/c/ sub1.example.com:443/a/b/c/?id=123 sub1.example.com:443/a/b/c/?id=123#fragment sub1.example.com:443/a/b/c?id=123 sub1.example.com:443/a/b/c?id=123#fragment The manager matches each of these sub-URLs against your Bloom filter and then against the PIR URL database if there’s a Bloom filter match. The verdict indicates if the app should block the requested URL. Note that the manager Punycodes the requested URL before parsing. Because of this, be sure to Punycode your own URL dataset before constructing your Bloom filter and PIR database. Neither the Bloom filter nor PIR supports wildcards or regular expressions. For a more flexible URL matching solution, use the urlParsingConfiguration property to select the URL components – the scheme, domain, path, query, fragment) – to include in the parsing results. You can also use the urlParsingRegularExpression property to implement custom parsing. Instances of this class are thread-safe.

## Topics

### Obtaining the shared instance

- [shared](networkextension/neurlfiltermanager/shared.md)

### Working with a Private Information Retrieval server

- [pirServerURL](networkextension/neurlfiltermanager/pirserverurl.md)
- [pirPrivacyPassIssuerURL](networkextension/neurlfiltermanager/pirprivacypassissuerurl.md)
- [pirAuthenticationToken](networkextension/neurlfiltermanager/pirauthenticationtoken.md)
- [refreshPIRParameters()](networkextension/neurlfiltermanager/refreshpirparameters().md)
- [resetPIRCache()](networkextension/neurlfiltermanager/resetpircache().md)

### Working with the filter configuration

- [setConfiguration(pirServerURL:pirPrivacyPassIssuerURL:pirAuthenticationToken:controlProviderBundleIdentifier:)](networkextension/neurlfiltermanager/setconfiguration(pirserverurl:pirprivacypassissuerurl:pirauthenticationtoken:controlproviderbundleidentifier:).md)
- [loadFromPreferences()](networkextension/neurlfiltermanager/loadfrompreferences().md)
- [saveToPreferences()](networkextension/neurlfiltermanager/savetopreferences().md)
- [removeFromPreferences()](networkextension/neurlfiltermanager/removefrompreferences().md)
- [handleConfigChange()](networkextension/neurlfiltermanager/handleconfigchange().md)

### Customizing filter parsing behavior

- [urlParsingConfiguration](networkextension/neurlfiltermanager/urlparsingconfiguration.md)
- [NEURLFilterManager.ParsingConfiguration](networkextension/neurlfiltermanager/parsingconfiguration.md)
- [urlParsingRegularExpression](networkextension/neurlfiltermanager/urlparsingregularexpression.md)
- [setURLParsingRegularExpression(_:)](networkextension/neurlfiltermanager/seturlparsingregularexpression(_:).md)

### Working with filter statuses

- [status](networkextension/neurlfiltermanager/status-swift.property.md)
- [handleStatusChange()](networkextension/neurlfiltermanager/handlestatuschange().md)
- [NEURLFilterManager.Status](networkextension/neurlfiltermanager/status-swift.enum.md)

### Managing filter life cycle

- [isEnabled](networkextension/neurlfiltermanager/isenabled.md)
- [shouldFailClosed](networkextension/neurlfiltermanager/shouldfailclosed.md)
- [prefilterFetchInterval](networkextension/neurlfiltermanager/prefilterfetchinterval.md)

### Producing filtering reports

- [reportEndpoint](networkextension/neurlfiltermanager/reportendpoint.md)
- [reportFormat](networkextension/neurlfiltermanager/reportformat-swift.property.md)
- [NEURLFilterManager.ReportFormat](networkextension/neurlfiltermanager/reportformat-swift.enum.md)
- [reportInterval](networkextension/neurlfiltermanager/reportinterval.md)

### Identifying app and extension bundles

- [appBundleIdentifier](networkextension/neurlfiltermanager/appbundleidentifier.md)
- [controlProviderBundleIdentifier](networkextension/neurlfiltermanager/controlproviderbundleidentifier.md)

### Handling errors

- [lastDisconnectError](networkextension/neurlfiltermanager/lastdisconnecterror.md)
- [NEURLFilterManager.Error](networkextension/neurlfiltermanager/error.md)

### Describing the filter

- [localizedDescription](networkextension/neurlfiltermanager/localizeddescription.md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### URL filters

- [NEURLFilterControlProvider](networkextension/neurlfiltercontrolprovider.md)
- [NEURLFilterControlProviderConfiguration](networkextension/neurlfiltercontrolproviderconfiguration.md)
- [NEURLFilter](networkextension/neurlfilter.md)
