Class Socks5BytestreamManager

  • All Implemented Interfaces:
    BytestreamManager

    public final class Socks5BytestreamManager
    extends Manager
    implements BytestreamManager
    The Socks5BytestreamManager class handles establishing SOCKS5 Bytestreams as specified in the XEP-0065.

    A SOCKS5 Bytestream is negotiated partly over the XMPP XML stream and partly over a separate socket. The actual transfer though takes place over a separately created socket.

    A SOCKS5 Bytestream generally has three parties, the initiator, the target, and the stream host. The stream host is a specialized SOCKS5 proxy setup on a server, or, the initiator can act as the stream host.

    To establish a SOCKS5 Bytestream invoke the establishSession(Jid) method. This will negotiate a SOCKS5 Bytestream with the given target JID and return a socket.

    If a session ID for the SOCKS5 Bytestream was already negotiated (e.g. while negotiating a file transfer) invoke establishSession(Jid, String).

    To handle incoming SOCKS5 Bytestream requests add an Socks5BytestreamListener to the manager. There are two ways to add this listener. If you want to be informed about incoming SOCKS5 Bytestreams from a specific user add the listener by invoking addIncomingBytestreamListener(BytestreamListener, Jid). If the listener should respond to all SOCKS5 Bytestream requests invoke addIncomingBytestreamListener(BytestreamListener).

    Note that the registered Socks5BytestreamListener will NOT be notified on incoming Socks5 bytestream requests sent in the context of XEP-0096 file transfer. (See FileTransferManager)

    If no Socks5BytestreamListeners are registered, all incoming SOCKS5 Bytestream requests will be rejected by returning a <not-acceptable/> error to the initiator.