Post

Replies

Boosts

Views

Activity

Reply to network extension case network disruption
I have written a simple [BSD sockets] test program and have undergone repeated testing, As a result, when I was browsing the web using Safari for a period of time, there was an outbound network outage, but I was able to connect to the computer using vnc。 This means that there is a problem with the outbound network, but the inbound network is normal。 I guess this may be related to my network proxy scheme This is my transparent proxy setting: NETransparentProxyNetworkSettings *settings = [[[NETransparentProxyNetworkSettings alloc]initWithTunnelRemoteAddress:@"127.0.0.1"] autorelease]; NSMutableArray *rules = [NSMutableArray array]; NSArray *ports = @[@80,@443]; for(NSNumber *port in ports){ NENetworkRule *rule4 = [[[NENetworkRule alloc]initWithRemoteNetwork:[NWHostEndpoint endpointWithHostname:@"0.0.0.0" port:[port description]] remotePrefix:0 localNetwork:0 localPrefix:0 protocol:NENetworkRuleProtocolTCP direction:NETrafficDirectionOutbound] autorelease]; NENetworkRule *rule6 = [[[NENetworkRule alloc]initWithRemoteNetwork:[NWHostEndpoint endpointWithHostname:@"::" port:[port description]] remotePrefix:0 localNetwork:0 localPrefix:0 protocol:NENetworkRuleProtocolTCP direction:NETrafficDirectionOutbound] autorelease]; [rules addObject:rule4]; [rules addObject:rule6]; } settings.includedNetworkRules = rules; [self setTunnelNetworkSettings:settings completionHandler:^(NSError * _Nullable error) { //my handle }]; I debugged the network extension and found that the network extension did not have any state transitions. but - [NETransparentProxyProvider handleNewFlow: (NEAppProxyFlow *) fw] is not being triggered. The outgoing BSD socket connection already established at this time When there is no data exchange, it normally closes and exits. When I upgraded OS 11.4 M1 to OS 13, the same test program did not reproduce the problem of network outages. I can provide the information you need as much as possible。 My problem is, even if the way I set up outgoing BSD socket connection is incorrect, Why is the [NETransparentProxyProvider handleNewFlow: (NEAppProxyFlow *) fw] callback not being triggered
Apr ’23