Hmmm, so it’s not that you don’t see DNS flows, it’s that you don’t see any flows. Right?
Pasted in below is the code I use to create the settings for my test transparent proxy. As you can see, it aims to capture outgoing TCP connections to port 12345. If you (temporarily, just for testing) use this code to configure your proxy, do you see handleNewFlow(_:)
called when you make an outgoing TCP connection to 12345?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
private func makeSettings() -> NETransparentProxyNetworkSettings {
// We want to see all outbound connections to port 12345.
let includedNetworks = [("0.0.0.0", 0), ("::", 0)]
.map { addr, prefix -> NENetworkRule in
let endpoint = NWHostEndpoint(hostname: addr, port: "12345")
return NENetworkRule(destinationNetwork: endpoint, prefix: prefix, protocol: .TCP)
}
// The address you pass to `tunnelRemoteAddress` is intended to be
// the IP address of the actual VPN server that you connected to. A
// real VPN would connect to
// `self.protocolConfiguration.serverAddress` and then report the
// remote address here. In our case we are not actually using a VPN
// server, so `self.protocolConfiguration.serverAddress` is
// `localhost`, and thus we simply pass in the loopback IP address.
let settings = NETransparentProxyNetworkSettings(tunnelRemoteAddress: "127.0.0.1")
// `NETunnelNetworkSettings` properties:
//
// `dnsSettings` and `proxySettings` are irrelevant to us.
// `NETransparentProxyNetworkSettings` properties…
//
settings.includedNetworkRules = includedNetworks
// `excludedNetworkRules`
return settings
}