-
Notifications
You must be signed in to change notification settings - Fork 47
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 handling #2
base: orfox-tb_GECKO380esr_2015050513_RELBRANCH
Are you sure you want to change the base?
Proxy handling #2
Conversation
Hey @str4d, can you just give me the changes you made to unify the proxy?? I'm working on NetCipher myself and will look into strongHttpsClient, but just the unification of proxy prefs would be nice with this PR |
If you were working on NetCipher yourself, you shouldn't have told me to go ahead and integrate it myself. I'd much rather not waste my time doing work that you aren't going to use, or are going to duplicate. When you say you want the changes I made to unify proxy, what exactly do you want?
|
I meant I'd review the StrongHttpsClient stuff, sorry about the NetCipher stuff though, I'm planning of doing it in a different way, that's why I'm not taking it from this PR. |
Also, if you could squash all the context commits together, something like what I've done at 68551e6, that would be easier to manage. |
9f36647
to
5f9c832
Compare
Good to know, thanks :) I've re-work the patch series to combine the early work into two commits. The centralized proxy settings commit still uses the route planner method, which as above doesn't work for SOCKS4a/5, but this PR on its own doesn't add SOCKS support, so it's fine. I have removed all commits after the inclusion of NetCipher because they have dependencies on |
Hey @str4d, there seem to be a ton of changes with the imports which aren't exactly changes, just moving them around. Could you please remove those? That way when I have to go through all this stuff for a future iteration, it'll be easier! |
Argh, sorry! Android Studio handles import formatting automatically, which is great - unless you want to import upstream later. I carefully removed those changes from the |
Awesome, thanks! Also, why exactly was the passing context thing required?? |
5f9c832
to
50e5a6c
Compare
Because On a related note, I've submitted the PR guardianproject/NetCipher#28 which adds support for multiple proxies to |
|
Ok, could you split these up into two PRs?? One with the context fix and one with the proxying one. |
Just jumping in here to say I'll review this PR and full thread tonight. |
Quick note though is that we decided not to rewrite all the Mozilla code to be HTTPClient-based instead of URLConnection at this point just based on time and resources. Splitting the proxying between HTTP and SOCKS doesn't inherently cause more problems, as long as we've done our job, but generally the SOCKS proxy directly to Tor is more high performance, which matters mostly for the GeckoView heavy lifting. |
Currently includes these changes:
StrongHttpsClient
instead ofDefaultHttpClient
.HttpRoutePlanner
but the issues with HttpClient 4.3 (lacking SOCKS4a/5 and lacking any way to overload the newer APIs until 4.4) mean that we have to stick with the deprecated API.org.mozilla.gecko.util.ProxySettings
.Moving to SOCKS can now be done for everything that uses
StrongHttpsClient
, by alteringProxySettings.setProxy()
. However, I am concerned that the code usingURL.openConnection()
(and callingProxySettings.getProxy()
) might need to be migrated toStrongHttpsClient
too? I haven't yet figured out how to overload that to add SOCKS4a/5 support, but rewriting the code that uses it to use HttpClient will be a mammoth undertaking, and make it much more difficult to pull in upstream changes. So overloadingURL.openConnection()
would be preferable.