diff options
author | Remko Tronçon <git@el-tramo.be> | 2012-06-02 16:40:22 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2012-06-17 07:34:57 (GMT) |
commit | f171bc207c2a7371ac6924ff467049dd0258aa00 (patch) | |
tree | eda5b5feb94dea264ea26b839b6f9ef5e32c915f /Swiften/Client/ClientOptions.h | |
parent | 5a1bdf2f6a4842176be5938f8db5cb9d151aceb5 (diff) | |
download | swift-contrib-f171bc207c2a7371ac6924ff467049dd0258aa00.zip swift-contrib-f171bc207c2a7371ac6924ff467049dd0258aa00.tar.bz2 |
Allow different connection methods for Client.
Diffstat (limited to 'Swiften/Client/ClientOptions.h')
-rw-r--r-- | Swiften/Client/ClientOptions.h | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/Swiften/Client/ClientOptions.h b/Swiften/Client/ClientOptions.h index fbec272..e5fcda9 100644 --- a/Swiften/Client/ClientOptions.h +++ b/Swiften/Client/ClientOptions.h @@ -17,7 +17,27 @@ namespace Swift { RequireTLS }; - ClientOptions() : useStreamCompression(true), useTLS(UseTLSWhenAvailable), allowPLAINWithoutTLS(false), useStreamResumption(false), forgetPassword(false), useAcks(true), boshHTTPConnectProxyAuthID(""), boshHTTPConnectProxyAuthPassword("") { + enum ProxyType { + NoProxy, + SystemConfiguredProxy, + SOCKS5Proxy, + HTTPConnectProxy + }; + + ClientOptions() : + useStreamCompression(true), + useTLS(UseTLSWhenAvailable), + allowPLAINWithoutTLS(false), + useStreamResumption(false), + forgetPassword(false), + useAcks(true), + manualHostname(""), + manualPort(-1), + proxyType(SystemConfiguredProxy), + manualProxyHostname(""), + manualProxyPort(-1), + boshHTTPConnectProxyAuthID(""), + boshHTTPConnectProxyAuthPassword("") { } /** @@ -66,6 +86,35 @@ namespace Swift { bool useAcks; /** + * The hostname to connect to. + * Leave this empty for standard XMPP connection, based on the JID domain. + */ + std::string manualHostname; + + /** + * The port to connect to. + * Leave this to -1 to use the port discovered by SRV lookups, and 5222 as a + * fallback. + */ + int manualPort; + + /** + * The type of proxy to use for connecting to the XMPP + * server. + */ + ProxyType proxyType; + + /** + * Override the system-configured proxy hostname. + */ + std::string manualProxyHostname; + + /** + * Override the system-configured proxy port. + */ + int manualProxyPort; + + /** * If non-empty, use BOSH instead of direct TCP, with the given URL. * Default: empty (no BOSH) */ |