[I must apologies for my previous post; I got confused and posted incorrect info, which I’ve corrected now.]
I saw from the log that there is 2 this value.
Right. That’s the value of
AF_INET
, indicating that this is an IPv4 packet. The other value you’re likely to see is 30, that is,
AF_INET6
.
Neither of these help you distinguish between the various protocols running over IP. To do that you’ll have to parse the IPv4 or IPv6 header (depending on the packet protocol number) to find the IP protocol number, which is likely to be either 6 (
IPPROTO_TCP
) or 17 (
IPPROTO_UDP
).
I still have a problem, according to thepost, PacketTunnelProvider can only proxy HTTP.
You are mixing up your layers here. A packet tunnel provider is connected at the IP layer, so it receives IP packets. In addition, any VPN can configure a set of custom proxies that apply when the VPN becomes the primary interface. If the VPN does that then HTTP[S] clients will use those proxies. However, the IP traffic generated by the HTTP[S] requests going to the proxy will still pass through the packet tunnel provider [1].
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
[1] Assuming they are routed via the default route. If the IP address of the proxy happens to hit a specific route — for example, a locally attached network, or a network that your provider has specifically excluded using the
excludedRoutes
property — they’ll be routed via the associated interface.