startSmart method

  1. @override
Future<ProxyInfo> startSmart({
  1. required SmartDialerConfig config,
  2. String localAddress = '127.0.0.1:0',
})
override

Starts a local proxy backed by the Smart Dialer, which automatically selects a working DNS/TLS strategy by probing SmartDialerConfig.testDomains.

Implementation

@override
Future<ProxyInfo> startSmart({
  required SmartDialerConfig config,
  String localAddress = '127.0.0.1:0',
}) async {
  try {
    final address = await methodChannel.invokeMethod<String>('startSmart', {
      'testDomains': config.testDomains,
      'strategiesConfig': config.strategiesConfig,
      'enableLogging': config.enableLogging,
      'localAddress': localAddress,
    });
    return ProxyInfo.fromAddress(address!);
  } on PlatformException catch (e) {
    throw _mapException(e);
  }
}