No. That is not the question.
Here is the case.
I have an ssh connection to outside somewhere.
And I start SimpleFirewall app with a modified filter like follows.
let anyHostAndPortRule = NENetworkRule(
remoteNetwork: nil,
remotePrefix: 0,
localNetwork: nil,
localPrefix: 0,
protocol: .any,
direction: .outbound
)
and here is my handleNewFlow
override func handleNewFlow(_ flow: NEFilterFlow) -> NEFilterNewFlowVerdict {
os_log("Received a new flow: %{public}@", flow.description)
guard let socketFlow = flow as? NEFilterSocketFlow,
let remoteEndpoint = socketFlow.remoteEndpoint as? NWHostEndpoint,
let localEndpoint = socketFlow.localEndpoint as? NWHostEndpoint else {
return .allow()
}
os_log("Got a new flow with local endpoint %@, remote endpoint %@", localEndpoint, remoteEndpoint)
return .allow()
}
Now, as soon as I start the filter, (by clicking the button in the app), what is happening is it freezes my existing ssh connection,
while I can open a new ssh connection to the same destination.
So My question is, is there any way I can add a filter without interrupting the existing connection?
My theory here is that apple network extension cannot handle
TCP loose cases. Is that true?