delayed_proxy_http_client 1.0.0 copy "delayed_proxy_http_client: ^1.0.0" to clipboard
delayed_proxy_http_client: ^1.0.0 copied to clipboard

HttpClient implementation which can resolve proxy server asynchronously.

Dart CI pub package

This lightweight package provides implementation of HttpClient extended with one property named findProxyAsync. It is designed to be used with packages like system_proxy_resolver which can resolve proxy server dynamically based on PAC script configured in OS settings.

Usage #

To use this plugin, add delayed_proxy_http_client as a dependency in your pubspec.yaml file.

Example #

Here is small example that show you how to use the API.

final client = DelayedProxyHttpClient();
client.findProxyAsync = (url) async {
  await Future.delayed(const Duration(seconds: 3));
  return url.host == "pub.dev" ? "PROXY localhost:3128" : "DIRECT";
};

final request = await client.getUrl(Uri.parse("https://pub.dev"));
final response = await request.close();
await stdout.addStream(response);
0
likes
130
pub points
1%
popularity

Publisher

verified publisherky1vstar.dev

HttpClient implementation which can resolve proxy server asynchronously.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on delayed_proxy_http_client