diff options
author | Tarun Gupta <tarun1995gupta@gmail.com> | 2015-07-26 07:47:40 (GMT) |
---|---|---|
committer | Tarun Gupta <tarun1995gupta@gmail.com> | 2015-08-17 13:21:01 (GMT) |
commit | f56f245c1f7e768caf356a0e7b57f428cf8cc6da (patch) | |
tree | f0935ab00c73e86163abe72fc9c20098121fff4f /src/com/isode/stroke/client/ClientOptions.java | |
parent | 2533374644704040ca67aba4e1240a9d6ea450c8 (diff) | |
download | stroke-f56f245c1f7e768caf356a0e7b57f428cf8cc6da.zip stroke-f56f245c1f7e768caf356a0e7b57f428cf8cc6da.tar.bz2 |
Update Client.
Updates all bits of Client to be in parity with Swiften.
Some part of code which depends on Network is commented.
License:
This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Test-Information:
Tests added for: ClientBlockListManager, ClientSession and NickResolver.
All tests pass.
Change-Id: I5b9b0e5ae5b2df58202e2349ba24e4544d9a4614
Diffstat (limited to 'src/com/isode/stroke/client/ClientOptions.java')
-rw-r--r-- | src/com/isode/stroke/client/ClientOptions.java | 78 |
1 files changed, 76 insertions, 2 deletions
diff --git a/src/com/isode/stroke/client/ClientOptions.java b/src/com/isode/stroke/client/ClientOptions.java index b410094..c2d9e3f 100644 --- a/src/com/isode/stroke/client/ClientOptions.java +++ b/src/com/isode/stroke/client/ClientOptions.java @@ -10,6 +10,8 @@ package com.isode.stroke.client; import com.isode.stroke.tls.TLSOptions; +import com.isode.stroke.base.URL; +import com.isode.stroke.base.SafeByteArray; /** * Options for a client connection @@ -40,7 +42,17 @@ public class ClientOptions { * Default: false */ public boolean useStreamResumption; - + + /** + * Forget the password once it's used. + * This makes the Client useless after the first login attempt. + * + * FIXME: This is a temporary workaround. + * + * Default: false + */ + public boolean forgetPassword; + /** * Use XEP-0198 acks in the stream when available. * Default: true @@ -48,6 +60,12 @@ public class ClientOptions { public boolean useAcks; /** + * Use Single Sign On. + * Default: false + */ + public boolean singleSignOn; + + /** * The hostname to connect to. * Leave this empty for standard XMPP connection, based on the JID domain. */ @@ -60,6 +78,48 @@ public class ClientOptions { */ public int manualPort; + /** + * The type of proxy to use for connecting to the XMPP + * server. + */ + public ProxyType proxyType; + + /** + * Override the system-configured proxy hostname. + */ + public String manualProxyHostname; + + /** + * Override the system-configured proxy port. + */ + public int manualProxyPort; + + /** + * If non-empty, use BOSH instead of direct TCP, with the given URL. + * Default: empty (no BOSH) + */ + public URL boshURL = new URL(); + + /** + * If non-empty, BOSH connections will try to connect over this HTTP CONNECT + * proxy instead of directly. + * Default: empty (no proxy) + */ + public URL boshHTTPConnectProxyURL = new URL(); + + /** + * If this and matching Password are non-empty, BOSH connections over + * HTTP CONNECT proxies will use these credentials for proxy access. + * Default: empty (no authentication needed by the proxy) + */ + public SafeByteArray boshHTTPConnectProxyAuthID; + public SafeByteArray boshHTTPConnectProxyAuthPassword; + + /** + * This can be initialized with a custom HTTPTrafficFilter, which allows HTTP CONNECT + * proxy initialization to be customized. + */ + //public HTTPTrafficFilter httpTrafficFilter; //TOPORT NETWORK /** * Options passed to the TLS stack @@ -72,14 +132,28 @@ public class ClientOptions { RequireTLS } + public enum ProxyType { + NoProxy, + SystemConfiguredProxy, + SOCKS5Proxy, + HTTPConnectProxy + }; + public ClientOptions() { useStreamCompression = true; useTLS = UseTLS.UseTLSWhenAvailable; - useStreamResumption = false; allowPLAINWithoutTLS = false; + useStreamResumption = false; + forgetPassword = false; useAcks = true; + singleSignOn = false; manualHostname = ""; manualPort = -1; + proxyType = ProxyType.SystemConfiguredProxy; + manualProxyHostname = ""; + manualProxyPort = -1; + boshHTTPConnectProxyAuthID = new SafeByteArray(""); + boshHTTPConnectProxyAuthPassword = new SafeByteArray(""); } @Override |