-
-
Notifications
You must be signed in to change notification settings - Fork 254
how to set PROXY when use sentry dio #1280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
When I was looking for the answer, I didn't find anything useful. SentryDioClientAdapter is not exposed to the outside world and cannot be used. #1015 also said that there is no solution. Later I found a way to replace it myself:
late HttpClientAdapter httpClientAdapter; Note: This step needs to be placed before dio.addSentry(), because addSentry will wrap httpClientAdapter as SentryDioClientAdapter.
|
|
@haozi5460 as mentioned here #1015 |
I know this, but after addSentry adds extensions, DefaultHttpClientAdapter becomes SentryDioClientAdapter, and SentryDioClientAdapter is not open to the outside world and cannot be called externally. |
bump, this is still a problem |
In my App, I use Dio to make network requests, but when I integrate Sentry_dio to monitor, I cannot set the network proxy.
Error display:
_dio.httpClientAdapter is SentryDioClientAdapter , not sub type of DefaultHttpClientAdapter.
The code is like: #1015
as written.
String proxy = "PROXY ${ipController.text}:${portController.text}";
(dio?.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate =
(client) {
client.findProxy = (url) {
return proxy;
};
//Trust certificate for https proxy
client.badCertificateCallback = (cert, host, port){
return true;
};
return client;
};
The text was updated successfully, but these errors were encountered: