Last updated:
0 purchases
native network proxy
proxy_setting #
A Flutter plugin for getting system proxy setting.
Getting Started #
Sample Code
import 'package:proxy_setting/proxy_setting.dart';
Map<String, String>? proxy = await ProxySetting.getProxySettings();
String? proxyHost;
String? proxyPort;
if (proxy != null) {
proxyHost = proxy['host'];
proxyPort = proxy['port'];
}
(dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate =
(client) {
if (proxyHost != null && proxyPort != null) {
client.findProxy = (uri) => "PROXY $proxyHost:$proxyPort;";
}
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
};
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.