1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 17:19:39 +02:00

Rework Proxy API

Instead of extending SocketFactory, the proxy support classes now
implement ProxySocketConnection. This removes a lot of unnecessary
code.

Also re-enables proxy support, which was broken in previous versions
because none of extended SocketFactories did override
createSocket() (SMACK-683).
This commit is contained in:
Florian Schmaus 2015-07-17 08:50:19 +02:00
parent 24365f0f1e
commit 7032688123
9 changed files with 104 additions and 266 deletions

View file

@ -37,6 +37,12 @@ public final class BOSHConfiguration extends ConnectionConfiguration {
private BOSHConfiguration(Builder builder) {
super(builder);
if (proxy != null) {
if (proxy.getProxyType() != ProxyInfo.ProxyType.HTTP) {
throw new IllegalArgumentException(
"Only HTTP proxies are support with BOSH connections");
}
}
https = builder.https;
if (builder.file.charAt(0) != '/') {
file = '/' + builder.file;
@ -46,7 +52,7 @@ public final class BOSHConfiguration extends ConnectionConfiguration {
}
public boolean isProxyEnabled() {
return (proxy != null && proxy.getProxyType() != ProxyInfo.ProxyType.NONE);
return proxy != null;
}
public ProxyInfo getProxyInfo() {