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

@ -177,6 +177,11 @@
<string name="pref_title_show_boosts">Show boosts</string>
<string name="pref_title_show_replies">Show replies</string>
<string name="pref_title_show_media_preview">Show media previews</string>
<string name="pref_title_proxy_settings">Proxy</string>
<string name="pref_title_http_proxy_settings">HTTP proxy</string>
<string name="pref_title_http_proxy_enable">Enable HTTP proxy</string>
<string name="pref_title_http_proxy_server">HTTP proxy server</string>
<string name="pref_title_http_proxy_port">HTTP proxy port</string>
<string-array name="pull_notification_check_interval_names">
<item>15 minutes</item>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/pref_title_http_proxy_settings"
xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference
android:defaultValue="true"
android:key="httpProxyEnabled"
android:title="@string/pref_title_http_proxy_enable" />
<EditTextPreference
android:key="httpProxyServer"
android:title="@string/pref_title_http_proxy_server"
android:summary="%s" />
<EditTextPreference
android:key="httpProxyPort"
android:title="@string/pref_title_http_proxy_port"
android:summary="%s" />
</PreferenceScreen>

View file

@ -74,4 +74,12 @@
android:title="@string/pref_title_edit_notification_settings" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_title_proxy_settings">
<Preference
android:key="httpProxyPreferences"
android:summary="%s"
android:title="@string/pref_title_http_proxy_settings" />
</PreferenceCategory>
</PreferenceScreen>