Hi, I am not able to see the localhost(127.0.0.1) connection request capture by the content filter network extension but all other connection is being intercepted by the NE. Is there any specific way to add in filter setting even after using following filter setting.
override func startFilter(completionHandler: @escaping (Error?) -> Void) {
let filterRules = ["0.0.0.0", "::"].map { address -> NEFilterRule in
let bothNetworkRule = NENetworkRule(remoteNetwork: nil,
remotePrefix: 0,
localNetwork: nil,
localPrefix: 0,
protocol: .any,
direction: .any )
return NEFilterRule(networkRule: bothNetworkRule, action: .filterData)
}
let filterSettings = NEFilterSettings(rules: filterRules, defaultAction: .allow)
apply(filterSettings) { error in
if let applyError = error {
os_log("Failed to apply filter settings: %@", applyError.localizedDescription)
}
completionHandler(error)
}
override func startFilter(completionHandler: @escaping (Error?) -> Void) {
let filterRules = ["0.0.0.0", "::"].map { address -> NEFilterRule in
let bothNetworkRule = NENetworkRule(remoteNetwork: nil,
remotePrefix: 0,
localNetwork: nil,
localPrefix: 0,
protocol: .any,
direction: .any )
return NEFilterRule(networkRule: bothNetworkRule, action: .filterData)
}
let filterSettings = NEFilterSettings(rules: filterRules, defaultAction: .allow)
apply(filterSettings) { error in
if let applyError = error {
os_log("Failed to apply filter settings: %@", applyError.localizedDescription)
}
completionHandler(error)
}