Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jonny Borges
2021-12-12 22:21:38 -0300
Browse Files
Options
Browse Files
Download
Plain Diff
Committed by
GitHub
2021-12-12 22:21:38 -0300
Commit
b797ae2b5c9039a00fd4837c6cba10751462da9a
b797ae2b
2 parents
6fe8013e
6207815f
Merge pull request #1973 from jtans/master
GetConnect support proxy setting
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
0 deletions
lib/get_connect/connect.dart
lib/get_connect/http/src/http.dart
lib/get_connect/http/src/http/io/http_request_io.dart
lib/get_connect/http/src/http/stub/http_request_stub.dart
lib/get_connect/connect.dart
View file @
b797ae2
...
...
@@ -115,6 +115,7 @@ class GetConnect extends GetConnectInterface {
Decoder
?
defaultDecoder
;
Duration
timeout
;
List
<
TrustedCertificate
>?
trustedCertificates
;
String
Function
(
Uri
url
)?
findProxy
;
GetHttpClient
?
_httpClient
;
List
<
GetSocket
>?
_sockets
;
bool
withCredentials
;
...
...
@@ -134,6 +135,7 @@ class GetConnect extends GetConnectInterface {
baseUrl:
baseUrl
,
trustedCertificates:
trustedCertificates
,
withCredentials:
withCredentials
,
findProxy:
findProxy
);
@override
...
...
lib/get_connect/http/src/http.dart
View file @
b797ae2
...
...
@@ -39,6 +39,8 @@ class GetHttpClient {
final
GetModifier
_modifier
;
String
Function
(
Uri
url
)?
findProxy
;
GetHttpClient
({
this
.
userAgent
=
'getx-client'
,
this
.
timeout
=
const
Duration
(
seconds:
8
),
...
...
@@ -50,10 +52,12 @@ class GetHttpClient {
this
.
baseUrl
,
List
<
TrustedCertificate
>?
trustedCertificates
,
bool
withCredentials
=
false
,
String
Function
(
Uri
url
)?
findProxy
,
})
:
_httpClient
=
HttpRequestImpl
(
allowAutoSignedCert:
allowAutoSignedCert
,
trustedCertificates:
trustedCertificates
,
withCredentials:
withCredentials
,
findProxy:
findProxy
,
),
_modifier
=
GetModifier
();
...
...
lib/get_connect/http/src/http/io/http_request_io.dart
View file @
b797ae2
...
...
@@ -17,6 +17,7 @@ class HttpRequestImpl extends HttpRequestBase {
bool
allowAutoSignedCert
=
true
,
List
<
TrustedCertificate
>?
trustedCertificates
,
bool
withCredentials
=
false
,
String
Function
(
Uri
url
)?
findProxy
,
})
{
_httpClient
=
io
.
HttpClient
();
if
(
trustedCertificates
!=
null
)
{
...
...
@@ -29,6 +30,7 @@ class HttpRequestImpl extends HttpRequestBase {
_httpClient
=
io
.
HttpClient
(
context:
_securityContext
);
_httpClient
!.
badCertificateCallback
=
(
_
,
__
,
___
)
=>
allowAutoSignedCert
;
_httpClient
!.
findProxy
=
findProxy
;
}
@override
...
...
lib/get_connect/http/src/http/stub/http_request_stub.dart
View file @
b797ae2
...
...
@@ -8,6 +8,7 @@ class HttpRequestImpl extends HttpRequestBase {
bool
allowAutoSignedCert
=
true
,
List
<
TrustedCertificate
>?
trustedCertificates
,
bool
withCredentials
=
false
,
String
Function
(
Uri
url
)?
findProxy
,
});
@override
void
close
()
{}
...
...
Please
register
or
login
to post a comment