Showing
4 changed files
with
9 additions
and
0 deletions
| @@ -115,6 +115,7 @@ class GetConnect extends GetConnectInterface { | @@ -115,6 +115,7 @@ class GetConnect extends GetConnectInterface { | ||
| 115 | Decoder? defaultDecoder; | 115 | Decoder? defaultDecoder; | 
| 116 | Duration timeout; | 116 | Duration timeout; | 
| 117 | List<TrustedCertificate>? trustedCertificates; | 117 | List<TrustedCertificate>? trustedCertificates; | 
| 118 | + String Function(Uri url)? findProxy; | ||
| 118 | GetHttpClient? _httpClient; | 119 | GetHttpClient? _httpClient; | 
| 119 | List<GetSocket>? _sockets; | 120 | List<GetSocket>? _sockets; | 
| 120 | bool withCredentials; | 121 | bool withCredentials; | 
| @@ -134,6 +135,7 @@ class GetConnect extends GetConnectInterface { | @@ -134,6 +135,7 @@ class GetConnect extends GetConnectInterface { | ||
| 134 | baseUrl: baseUrl, | 135 | baseUrl: baseUrl, | 
| 135 | trustedCertificates: trustedCertificates, | 136 | trustedCertificates: trustedCertificates, | 
| 136 | withCredentials: withCredentials, | 137 | withCredentials: withCredentials, | 
| 138 | + findProxy: findProxy | ||
| 137 | ); | 139 | ); | 
| 138 | 140 | ||
| 139 | @override | 141 | @override | 
| @@ -39,6 +39,8 @@ class GetHttpClient { | @@ -39,6 +39,8 @@ class GetHttpClient { | ||
| 39 | 39 | ||
| 40 | final GetModifier _modifier; | 40 | final GetModifier _modifier; | 
| 41 | 41 | ||
| 42 | + String Function(Uri url)? findProxy; | ||
| 43 | + | ||
| 42 | GetHttpClient({ | 44 | GetHttpClient({ | 
| 43 | this.userAgent = 'getx-client', | 45 | this.userAgent = 'getx-client', | 
| 44 | this.timeout = const Duration(seconds: 8), | 46 | this.timeout = const Duration(seconds: 8), | 
| @@ -50,10 +52,12 @@ class GetHttpClient { | @@ -50,10 +52,12 @@ class GetHttpClient { | ||
| 50 | this.baseUrl, | 52 | this.baseUrl, | 
| 51 | List<TrustedCertificate>? trustedCertificates, | 53 | List<TrustedCertificate>? trustedCertificates, | 
| 52 | bool withCredentials = false, | 54 | bool withCredentials = false, | 
| 55 | + String Function(Uri url)? findProxy, | ||
| 53 | }) : _httpClient = HttpRequestImpl( | 56 | }) : _httpClient = HttpRequestImpl( | 
| 54 | allowAutoSignedCert: allowAutoSignedCert, | 57 | allowAutoSignedCert: allowAutoSignedCert, | 
| 55 | trustedCertificates: trustedCertificates, | 58 | trustedCertificates: trustedCertificates, | 
| 56 | withCredentials: withCredentials, | 59 | withCredentials: withCredentials, | 
| 60 | + findProxy: findProxy, | ||
| 57 | ), | 61 | ), | 
| 58 | _modifier = GetModifier(); | 62 | _modifier = GetModifier(); | 
| 59 | 63 | 
| @@ -17,6 +17,7 @@ class HttpRequestImpl extends HttpRequestBase { | @@ -17,6 +17,7 @@ class HttpRequestImpl extends HttpRequestBase { | ||
| 17 | bool allowAutoSignedCert = true, | 17 | bool allowAutoSignedCert = true, | 
| 18 | List<TrustedCertificate>? trustedCertificates, | 18 | List<TrustedCertificate>? trustedCertificates, | 
| 19 | bool withCredentials = false, | 19 | bool withCredentials = false, | 
| 20 | + String Function(Uri url)? findProxy, | ||
| 20 | }) { | 21 | }) { | 
| 21 | _httpClient = io.HttpClient(); | 22 | _httpClient = io.HttpClient(); | 
| 22 | if (trustedCertificates != null) { | 23 | if (trustedCertificates != null) { | 
| @@ -29,6 +30,7 @@ class HttpRequestImpl extends HttpRequestBase { | @@ -29,6 +30,7 @@ class HttpRequestImpl extends HttpRequestBase { | ||
| 29 | 30 | ||
| 30 | _httpClient = io.HttpClient(context: _securityContext); | 31 | _httpClient = io.HttpClient(context: _securityContext); | 
| 31 | _httpClient!.badCertificateCallback = (_, __, ___) => allowAutoSignedCert; | 32 | _httpClient!.badCertificateCallback = (_, __, ___) => allowAutoSignedCert; | 
| 33 | + _httpClient!.findProxy = findProxy; | ||
| 32 | } | 34 | } | 
| 33 | 35 | ||
| 34 | @override | 36 | @override | 
| @@ -8,6 +8,7 @@ class HttpRequestImpl extends HttpRequestBase { | @@ -8,6 +8,7 @@ class HttpRequestImpl extends HttpRequestBase { | ||
| 8 | bool allowAutoSignedCert = true, | 8 | bool allowAutoSignedCert = true, | 
| 9 | List<TrustedCertificate>? trustedCertificates, | 9 | List<TrustedCertificate>? trustedCertificates, | 
| 10 | bool withCredentials = false, | 10 | bool withCredentials = false, | 
| 11 | + String Function(Uri url)? findProxy, | ||
| 11 | }); | 12 | }); | 
| 12 | @override | 13 | @override | 
| 13 | void close() {} | 14 | void close() {} | 
- 
Please register or login to post a comment