implement support for HTTP proxy (#489)

This change allows the user to manually enter an unauthenticated proxy
configuration to be used for all API connections. This is mainly
intended for using Tusky with Tor (via Orbot or a local proxy).
This commit is contained in:
Sergio López 2017-12-26 21:45:08 +01:00 committed by Konrad Pozniak
commit 7c83e0f87d
9 changed files with 149 additions and 8 deletions

View file

@ -137,8 +137,10 @@ public abstract class BaseActivity extends AppCompatActivity {
.registerTypeAdapter(Spanned.class, new SpannedTypeAdapter())
.create();
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
OkHttpClient.Builder okBuilder =
OkHttpUtils.getCompatibleClientBuilder()
OkHttpUtils.getCompatibleClientBuilder(preferences)
.addInterceptor(new AuthInterceptor(this))
.dispatcher(mastodonApiDispatcher);