mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-09 10:19:41 +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:
parent
24365f0f1e
commit
7032688123
9 changed files with 104 additions and 266 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue