<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEURLFilterManager",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "s:16NetworkExtension18NEURLFilterManagerC"
  },
  "title" : "NEURLFilterManager"
}
-->

# NEURLFilterManager

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

```
class NEURLFilterManager
```

## 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 <doc://com.apple.documentation/documentation/WebKit> and <doc://com.apple.documentation/documentation/Foundation/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`](/documentation/NetworkExtension/NEURLFilterManager/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`](/documentation/NetworkExtension/NEURLFilterManager/urlParsingRegularExpression) property to implement custom parsing.

Instances of this class are thread-safe.

## Topics

### Obtaining the shared instance

[`shared`](/documentation/NetworkExtension/NEURLFilterManager/shared)

The shared filter manager instance your app uses to manage URL filters.

### Working with a Private Information Retrieval server

[`pirServerURL`](/documentation/NetworkExtension/NEURLFilterManager/pirServerURL)

A URL that contains the domain name of the PIR server.

[`pirPrivacyPassIssuerURL`](/documentation/NetworkExtension/NEURLFilterManager/pirPrivacyPassIssuerURL)

A URL that contains the domain name of Privacy Pass issuer.

[`pirAuthenticationToken`](/documentation/NetworkExtension/NEURLFilterManager/pirAuthenticationToken)

A PIR per-user authentication token string.

[`refreshPIRParameters()`](/documentation/NetworkExtension/NEURLFilterManager/refreshPIRParameters())

Refetches PIR parameters from the server.

[`resetPIRCache()`](/documentation/NetworkExtension/NEURLFilterManager/resetPIRCache())

Resets the PIR on-device cache.

### Working with the filter configuration

[`setConfiguration(pirServerURL:pirPrivacyPassIssuerURL:pirAuthenticationToken:controlProviderBundleIdentifier:)`](/documentation/NetworkExtension/NEURLFilterManager/setConfiguration(pirServerURL:pirPrivacyPassIssuerURL:pirAuthenticationToken:controlProviderBundleIdentifier:))

Sets a URL filter configuration with the required PIR server attributes and app extension information.

[`loadFromPreferences()`](/documentation/NetworkExtension/NEURLFilterManager/loadFromPreferences())

Loads the current URL filter configuration from the caller’s URL filter preferences.

[`saveToPreferences()`](/documentation/NetworkExtension/NEURLFilterManager/saveToPreferences())

Saves the URL filter configuration in the caller’s URL filter preferences.

[`removeFromPreferences()`](/documentation/NetworkExtension/NEURLFilterManager/removeFromPreferences())

Removes the URL filter configuration from the caller’s URL filter preferences.

[`handleConfigChange()`](/documentation/NetworkExtension/NEURLFilterManager/handleConfigChange())

Sets up an observer for the filter configuration change notification and models it as an asynchronous sequence.

### Customizing filter parsing behavior

[`urlParsingConfiguration`](/documentation/NetworkExtension/NEURLFilterManager/urlParsingConfiguration)

A property to configure the filter’s parser behavior.

[`NEURLFilterManager.ParsingConfiguration`](/documentation/NetworkExtension/NEURLFilterManager/ParsingConfiguration)

A type to configure the filter’s parser behavior.

[`urlParsingRegularExpression`](/documentation/NetworkExtension/NEURLFilterManager/urlParsingRegularExpression)

A regular expression used for advanced URL parsing.

[`setURLParsingRegularExpression(_:)`](/documentation/NetworkExtension/NEURLFilterManager/setURLParsingRegularExpression(_:))

Sets a regular expression for use in URL parsing.

### Working with filter statuses

[`status`](/documentation/NetworkExtension/NEURLFilterManager/status-swift.property)

The current status of the URL filter.

[`handleStatusChange()`](/documentation/NetworkExtension/NEURLFilterManager/handleStatusChange())

Sets up an observer for the status notification and models it as an asynchronous sequence.

[`NEURLFilterManager.Status`](/documentation/NetworkExtension/NEURLFilterManager/Status-swift.enum)

An enumeration of URL filter status codes.

### Managing filter life cycle

[`isEnabled`](/documentation/NetworkExtension/NEURLFilterManager/isEnabled)

A Boolean value that toggles the enabled status of the URL filter.

[`shouldFailClosed`](/documentation/NetworkExtension/NEURLFilterManager/shouldFailClosed)

A Boolean value that determines how the filter behaves if it fails to make a filtering decision.

[`prefilterFetchInterval`](/documentation/NetworkExtension/NEURLFilterManager/prefilterFetchInterval)

The time interval at which the the filter control provider app extension runs.

### Producing filtering reports

[`reportEndpoint`](/documentation/NetworkExtension/NEURLFilterManager/reportEndpoint)

The endpoint that the filter manager sends blocked URL reports to.

[`reportFormat`](/documentation/NetworkExtension/NEURLFilterManager/reportFormat-swift.property)

The format the manager uses to send blocked URL reports.

[`NEURLFilterManager.ReportFormat`](/documentation/NetworkExtension/NEURLFilterManager/ReportFormat-swift.enum)

An enumertion of report format types used when reporting blocked URLs.

[`reportInterval`](/documentation/NetworkExtension/NEURLFilterManager/reportInterval)

The time interval (in seconds) at which the system sends reports of blocked URLs.

### Identifying app and extension bundles

[`appBundleIdentifier`](/documentation/NetworkExtension/NEURLFilterManager/appBundleIdentifier)

The bundle identifier of the URL filter app.

[`controlProviderBundleIdentifier`](/documentation/NetworkExtension/NEURLFilterManager/controlProviderBundleIdentifier)

The bundle identifier of the filter controller provider app extension.

### Handling errors

[`lastDisconnectError`](/documentation/NetworkExtension/NEURLFilterManager/lastDisconnectError)

The most recent error that caused the URL Filter to stop.

[`NEURLFilterManager.Error`](/documentation/NetworkExtension/NEURLFilterManager/Error)

An enumeration of URL filter error codes

### Describing the filter

[`localizedDescription`](/documentation/NetworkExtension/NEURLFilterManager/localizedDescription)

A string containing a description of the URL filter.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)