flutter_traceroute 0.0.1%2B2

SDKflutter
Platformandroidios

A minimalist Flutter plugin for performing TRACEROUTE on Android and iOS using native libraries.

Flutter Traceroute

A minimalist Flutter plugin for performing TRACEROUTE Currently supported on Android and IOS

Limitations

  • TTL is not supported on Android
  • IOS takes a little more time between steps, not sure what the root cause is

Installation

IOS

At the beginning of your Podfile, set the ios platform version to 14

platform :ios, '14.0'

At the end of your Podfile, add the following pods

pod 'SimplePing', :git => 'https://github.com/youssef-fk/SimplePing.git'
pod 'SimpleTracer', :git => 'https://github.com/youssef-fk/SimpleTracer.git'

Android

All set

Usage

const args = TracerouteArgs(
  host: '8.8.8.8',
  ttl: 20, // IOS ONLY
);
final stream = FlutterTraceroute().trace(args);
stream.listen((event) {
  if (event is TracerouteStepStart) {} // ...
  if (event is TracerouteStepRouter) {} // ...
  if (event is TracerouteStepRouterDoesNotRespond) {} // ...
  if (event is TracerouteStepFinished) {} // ...
  if (event is TracerouteStepFailed) {} // ...
});

Objects definitions

ClassAttributesDescription
TracerouteStep-Base class
TracerouteStepStartString host, String ip, int ttlBase class
TracerouteStepRouterint step, String ip, int durationRouter jump
TracerouteStepRouterDoesNotRespondint stepJump timeout
TracerouteStepFinishedint step, String ip, int latencyEnd of trace
TracerouteStepFailedString errorTrace error

Screenshot

Example screenshot

Contributing

Pull requests are welcome!

License

MIT