iOS NEPacketTunnelProvider calculate traffic without packetFlow

100 Views Asked by At

i've got a case, when i've successfully run Packet - Tunnel with NEPacketTunnelProvider (socks protocol) for iOS platform

And i can't found a way to calculate traffic.

I've tried with usage

self.packetFlow.readPackets...  

self.packetFlow.writePackets... 

with different ways, but each time when i call methods, which contains lines with packet flow, nothing happens, i think its related to my protocol and library which i've use to implement packet tuneling, cause its freeze the thread. By the way its working great in memory limits of iOS.

i've see that the profiler in xcode is showing spended traffic.

I've also trying to get with functions

getifaddrs(..)..

name of virtual interface which extension is create for use, and by the name, found virtual adapter, but all fields of objects there, which i found, doesn't provide any helpful information related to size of packages information

Also i've tried to implement custom NEPacketTunnelFlow, and use them in NEPacketTunnelProvider, but as the result NEPacketTunnelProvider not starting, and crashing without any helpful information.

All information in documentation, doesn't help to understand how to implement. Also will great to know, how the big vpn/proxy apps implementing traffic limits for their user, based on server side or on the application side?

Can someone give some prompts where i can found some ways of solution?

0

There are 0 best solutions below