setupProxy method

void setupProxy(
  1. String host,
  2. int port
)

设置代理(不支持Web)

Implementation

void setupProxy(String host, int port) {
  _client!.httpClientAdapter = IOHttpClientAdapter(
    createHttpClient: () {
      final client = HttpClient();
      client.findProxy = (uri) => 'PROXY $host:$port';
      client.badCertificateCallback =
          (X509Certificate cert, String host, int port) => true;
      return client;
    },
  );
}