public final class Socks5ByteStreamManager extends ByteStreamManager
A manager for XEP-0065: SOCKS5 Bytestreams.
If enabled, this class starts a local SOCKS5 server to support direct connections between two entities. You can set a port of this local server, if you don’t set a port, the default port 1080 is used.
It also allows you to initiate a byte stream session with another entity.
If you don’t want to discover stream hosts, but want to configure your own, set a custom stream host.
Modifier and Type | Method and Description |
---|---|
AsyncResult<java.util.List<StreamHost>> |
discoverProxies()
Discovers the SOCKS5 proxies.
|
AsyncResult<java.util.List<StreamHost>> |
getAvailableStreamHosts()
Gets a list of available stream hosts, including the discovered proxies and the local host.
|
int |
getPort()
Gets the port of the local host.
|
StreamHost |
getStreamHost()
Gets the configured stream host.
|
AsyncResult<ByteStreamSession> |
initiateSession(Jid target,
java.lang.String sessionId)
Initiates a SOCKS5 session with a target.
|
boolean |
isLocalHostEnabled()
Indicates whether the local host is enabled.
|
void |
setLocalHostEnabled(boolean enabled)
Enables or disables the use of a local SOCKS5 host.
|
void |
setPort(int port)
Sets the port of the local host.
|
void |
setStreamHost(StreamHost streamHost)
Configures a custom stream host.
|
addByteStreamListener, removeByteStreamListener
isEnabled, setEnabled
public boolean isLocalHostEnabled()
Indicates whether the local host is enabled.
public void setLocalHostEnabled(boolean enabled)
Enables or disables the use of a local SOCKS5 host.
enabled
- If enabled.public int getPort()
Gets the port of the local host.
public void setPort(int port)
Sets the port of the local host.
port
- The port.public AsyncResult<java.util.List<StreamHost>> discoverProxies()
Discovers the SOCKS5 proxies.
public AsyncResult<java.util.List<StreamHost>> getAvailableStreamHosts()
Gets a list of available stream hosts, including the discovered proxies and the local host.
public void setStreamHost(StreamHost streamHost)
Configures a custom stream host. If a stream host is set this way, no stream hosts are discovered, but the configured one is used instead.
streamHost
- The stream host.public StreamHost getStreamHost()
Gets the configured stream host.
public AsyncResult<ByteStreamSession> initiateSession(Jid target, java.lang.String sessionId)
Initiates a SOCKS5 session with a target.
target
- The target.sessionId
- The session id.Copyright © 2014–2019 XMPP.rocks. All rights reserved.