Skip to content

Commit 17758f8

Browse files
committed
Initial Commit
0 parents  commit 17758f8

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Flutter System Proxy
2+
3+
A Flutter Plugin to detect System proxy. When using HTTP client that are not proxy aware this plugin can help with finding the proxy from system settings which then can be used with HTTP Client to make a successful request.
4+
5+
## Getting Started
6+
7+
### Installation
8+
9+
```yaml
10+
11+
flutter_system_proxy:
12+
git:
13+
url: https://github.com:Rushabhshroff/flutter_system_proxy.git
14+
15+
```
16+
17+
### Usage (Example With Dio)
18+
19+
```dart
20+
import 'package:flutter_system_proxy/flutter_system_proxy.dart';
21+
22+
23+
...
24+
25+
26+
var dio = new Dio();
27+
var url = "http://....";
28+
var proxy = await FlutterSystemProxy.findProxyFromEnvironment(url);
29+
(dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate =
30+
(HttpClient client) {
31+
client.findProxy = (uri) {
32+
return proxy;
33+
};
34+
};
35+
var response = await dio.get(url);
36+
```

0 commit comments

Comments
 (0)