-
Notifications
You must be signed in to change notification settings - Fork 507
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
Proxy support for Android and IOS #1727
base: master
Are you sure you want to change the base?
Proxy support for Android and IOS #1727
Conversation
@marcmcl - have a look at the check failures on GitHub:
|
@marcmcl - two further comments:
|
This item has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@brunobowden I added the missing files and have also included my plugin files as well. Managed to get hostname and port working for proxy on IOS too. Still no support for proxy authentication on both IOS and Android implementations. IOS implementation also doesn't autoconfig proxies specified via PAC yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @marcmcl, thanks for contributing this. It'll take me more time to look at this. Here's some initial cursory observations.
@marcmcl - there's also a conflict in
|
- Added get_proxy plugin files which includes some IOS support
05dcc57
to
eaabc6f
Compare
@brunobowden going to retest tomorrow then I will mark the PR as ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcmcl - thanks for pressing on with this. Sorry to ask you to rename lots of file as that's a painful process. Feel free to discuss / push back on the name. We should be thoughtful about that so we don't need to change it later on.
There's also two further client fetches using webHelper.downloadFile
in caching.dart
. Though should also use the proxy but I'm not quite sure how to do it:
https://github.com/WorldHealthOrganization/app/blob/master/client/lib/api/content/caching.dart#L44
|
||
var client = new HttpClient(); | ||
String proxy = await GetProxy.getProxy; | ||
if(proxy!="") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing space after if
@@ -4,7 +4,8 @@ import 'package:who_app/main.dart'; | |||
import 'package:who_app/api/user_preferences.dart'; | |||
import 'package:http/http.dart' as http; | |||
import 'dart:io' as io; | |||
|
|||
import 'package:get_proxy/get_proxy.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of get_proxy
, should it be http_proxy
? You're not getting a proxy but using it for requests. It should match the http.post
API as much as possible. The used class can then be httpProxy
which more closely matches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a heads up that get_proxy was literally just getting the proxy information. But I'll move the http.post alternative into this package and rename it as you suggest @brunobowden .
@@ -24,7 +25,7 @@ class WhoService { | |||
final postBody = jsonEncode(req.toProto3Json()); | |||
|
|||
final url = '$serviceUrl/putDeviceToken'; | |||
final response = await http.post(url, headers: headers, body: postBody); | |||
final response = await httpPost(url, headers, postBody); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General thought is that the http.post
APIs will have a lot of thought that's gone in to them. So my suggestion was to use the same API for httpPost
. It also benefits users as they can use the same syntax and it benefits reviewers as there's fewer changes switching from one to the other. So you'd expect the new line to be:
final response = await httpPost(url, headers, postBody); | |
final response = await await httpProxy.post(url, headers: headers, body: postBody); |
This item has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This item has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Screenshots
Screenshots
Add any relevant before/after screenshots hereHow did you test the change?
curl
to a dev App Engine serverTested by manually specifying proxy host and port, as well as with a proxy.pac URL.
Checklist: