start method

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

Starts a local proxy that forwards traffic through the given transportConfig.

See https://pkg.go.dev/golang.getoutline.org/sdk/x/configurl#hdr-Config_Format for the configuration string format (e.g. Shadowsocks URLs, split:, socks5://, chained transports, etc).

localAddress is the address the local proxy listens on. Use port 0 (the default) to let the OS pick a free port.

Implementation

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