Search in sources :

Example 1 with Item

use of org.jivesoftware.smackx.disco.packet.DiscoverItems.Item in project Smack by igniterealtime.

the class Socks5ByteStreamManagerTest method shouldFailIfTargetDoesNotAcceptSocks5Bytestream.

/**
 * Invoking {@link Socks5BytestreamManager#establishSession(org.jxmpp.jid.Jid, String)} should fail if the
 * target does not accept a SOCKS5 Bytestream. See <a
 * href="http://xmpp.org/extensions/xep-0065.html#usecase-alternate">XEP-0065 Section 5.2 A2</a>
 * @throws InterruptedException if the calling thread was interrupted.
 * @throws SmackException if Smack detected an exceptional situation.
 * @throws XMPPException if an XMPP protocol error was received.
 * @throws IOException if an I/O error occurred.
 */
@Test
public void shouldFailIfTargetDoesNotAcceptSocks5Bytestream() throws SmackException, InterruptedException, IOException, XMPPException {
    final Protocol protocol = new Protocol();
    final XMPPConnection connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID);
    final String sessionID = "session_id_shouldFailIfTargetDoesNotAcceptSocks5Bytestream";
    // get Socks5ByteStreamManager for connection
    Socks5BytestreamManager byteStreamManager = Socks5BytestreamManager.getBytestreamManager(connection);
    byteStreamManager.setAnnounceLocalStreamHost(false);
    /**
     * create responses in the order they should be queried specified by the XEP-0065
     * specification
     */
    // build discover info that supports the SOCKS5 feature
    DiscoverInfoBuilder discoverInfo = Socks5PacketUtils.createDiscoverInfo(targetJID, initiatorJID);
    discoverInfo.addFeature(Bytestream.NAMESPACE);
    // return that SOCKS5 is supported if target is queried
    protocol.addResponse(discoverInfo.build(), Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build discover items containing a proxy item
    DiscoverItems discoverItems = Socks5PacketUtils.createDiscoverItems(xmppServer, initiatorJID);
    Item item = new Item(proxyJID);
    discoverItems.addItem(item);
    // return the proxy item if XMPP server is queried
    protocol.addResponse(discoverItems, Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build discover info for proxy containing information about being a SOCKS5 proxy
    DiscoverInfoBuilder proxyInfo = Socks5PacketUtils.createDiscoverInfo(proxyJID, initiatorJID);
    Identity identity = new Identity("proxy", proxyJID.toString(), "bytestreams");
    proxyInfo.addIdentity(identity);
    // return the socks5 bytestream proxy identity if proxy is queried
    protocol.addResponse(proxyInfo.build(), Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build a socks5 stream host info containing the address and the port of the
    // proxy
    Bytestream streamHostInfo = Socks5PacketUtils.createBytestreamResponse(proxyJID, initiatorJID);
    streamHostInfo.addStreamHost(proxyJID, proxyAddress, 7778);
    // return stream host info if it is queried
    protocol.addResponse(streamHostInfo, Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build error packet to reject SOCKS5 Bytestream
    StanzaError stanzaError = StanzaError.getBuilder(StanzaError.Condition.not_acceptable).build();
    IQ rejectPacket = new ErrorIQ(stanzaError);
    rejectPacket.setFrom(targetJID);
    rejectPacket.setTo(initiatorJID);
    // return error packet as response to the bytestream initiation
    protocol.addResponse(rejectPacket, Verification.correspondingSenderReceiver, Verification.requestTypeSET);
    XMPPErrorException e = assertThrows(XMPPErrorException.class, () -> {
        // start SOCKS5 Bytestream
        byteStreamManager.establishSession(targetJID, sessionID);
    });
    protocol.verifyAll();
    assertEquals(rejectPacket.getError(), e.getStanzaError());
}
Also used : ErrorIQ(org.jivesoftware.smack.packet.ErrorIQ) XMPPErrorException(org.jivesoftware.smack.XMPPException.XMPPErrorException) DiscoverInfoBuilder(org.jivesoftware.smackx.disco.packet.DiscoverInfoBuilder) ErrorIQ(org.jivesoftware.smack.packet.ErrorIQ) IQ(org.jivesoftware.smack.packet.IQ) DiscoverItems(org.jivesoftware.smackx.disco.packet.DiscoverItems) XMPPConnection(org.jivesoftware.smack.XMPPConnection) StanzaError(org.jivesoftware.smack.packet.StanzaError) Item(org.jivesoftware.smackx.disco.packet.DiscoverItems.Item) Bytestream(org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream) Protocol(org.jivesoftware.util.Protocol) Identity(org.jivesoftware.smackx.disco.packet.DiscoverInfo.Identity) Test(org.junit.jupiter.api.Test)

Example 2 with Item

use of org.jivesoftware.smackx.disco.packet.DiscoverItems.Item in project Smack by igniterealtime.

the class Socks5ByteStreamManagerTest method shouldFailIfTargetUsesInvalidSocks5Proxy.

/**
 * Invoking {@link Socks5BytestreamManager#establishSession(org.jxmpp.jid.Jid, String)} should fail if the
 * proxy used by target is invalid.
 *
 * @throws InterruptedException if the calling thread was interrupted.
 * @throws SmackException if Smack detected an exceptional situation.
 * @throws XMPPException if an XMPP protocol error was received.
 * @throws IOException if an I/O error occurred.
 */
@Test
public void shouldFailIfTargetUsesInvalidSocks5Proxy() throws SmackException, InterruptedException, IOException, XMPPException {
    final Protocol protocol = new Protocol();
    final XMPPConnection connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID);
    final String sessionID = "session_id_shouldFailIfTargetUsesInvalidSocks5Proxy";
    // get Socks5ByteStreamManager for connection
    Socks5BytestreamManager byteStreamManager = Socks5BytestreamManager.getBytestreamManager(connection);
    // TODO: It appears that it is not required to disable the local stream host for this unit test.
    byteStreamManager.setAnnounceLocalStreamHost(false);
    /**
     * create responses in the order they should be queried specified by the XEP-0065
     * specification
     */
    // build discover info that supports the SOCKS5 feature
    DiscoverInfoBuilder discoverInfo = Socks5PacketUtils.createDiscoverInfo(targetJID, initiatorJID);
    discoverInfo.addFeature(Bytestream.NAMESPACE);
    // return that SOCKS5 is supported if target is queried
    protocol.addResponse(discoverInfo.build(), Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build discover items containing a proxy item
    DiscoverItems discoverItems = Socks5PacketUtils.createDiscoverItems(xmppServer, initiatorJID);
    Item item = new Item(proxyJID);
    discoverItems.addItem(item);
    // return the proxy item if XMPP server is queried
    protocol.addResponse(discoverItems, Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build discover info for proxy containing information about being a SOCKS5 proxy
    DiscoverInfoBuilder proxyInfo = Socks5PacketUtils.createDiscoverInfo(proxyJID, initiatorJID);
    Identity identity = new Identity("proxy", proxyJID.toString(), "bytestreams");
    proxyInfo.addIdentity(identity);
    // return the socks5 bytestream proxy identity if proxy is queried
    protocol.addResponse(proxyInfo.build(), Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build a socks5 stream host info containing the address and the port of the
    // proxy
    Bytestream streamHostInfo = Socks5PacketUtils.createBytestreamResponse(proxyJID, initiatorJID);
    streamHostInfo.addStreamHost(proxyJID, proxyAddress, 7778);
    // return stream host info if it is queried
    protocol.addResponse(streamHostInfo, Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build used stream host response with unknown proxy
    Bytestream streamHostUsedPacket = Socks5PacketUtils.createBytestreamResponse(targetJID, initiatorJID);
    streamHostUsedPacket.setSessionID(sessionID);
    streamHostUsedPacket.setUsedHost(JidCreate.from("invalid.proxy"));
    // return used stream host info as response to the bytestream initiation
    protocol.addResponse(streamHostUsedPacket, Verification.correspondingSenderReceiver, Verification.requestTypeSET);
    SmackException e = assertThrows(SmackException.class, () -> {
        // start SOCKS5 Bytestream
        byteStreamManager.establishSession(targetJID, sessionID);
    });
    protocol.verifyAll();
    assertTrue(e.getMessage().contains("Remote user responded with unknown host"));
}
Also used : Item(org.jivesoftware.smackx.disco.packet.DiscoverItems.Item) Bytestream(org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream) DiscoverInfoBuilder(org.jivesoftware.smackx.disco.packet.DiscoverInfoBuilder) SmackException(org.jivesoftware.smack.SmackException) DiscoverItems(org.jivesoftware.smackx.disco.packet.DiscoverItems) XMPPConnection(org.jivesoftware.smack.XMPPConnection) Protocol(org.jivesoftware.util.Protocol) Identity(org.jivesoftware.smackx.disco.packet.DiscoverInfo.Identity) Test(org.junit.jupiter.api.Test)

Example 3 with Item

use of org.jivesoftware.smackx.disco.packet.DiscoverItems.Item in project Smack by igniterealtime.

the class Socks5ByteStreamManagerTest method shouldBlacklistNonSocks5Proxies.

/**
 * Invoking {@link Socks5BytestreamManager#establishSession(org.jxmpp.jid.Jid, String)} should fail if no
 * SOCKS5 proxy can be found. If it turns out that a proxy is not a SOCKS5 proxy it should not
 * be queried again.
 * @throws InterruptedException if the calling thread was interrupted.
 * @throws SmackException if Smack detected an exceptional situation.
 * @throws XMPPException if an XMPP protocol error was received.
 * @throws IOException if an I/O error occurred.
 */
@Test
public void shouldBlacklistNonSocks5Proxies() throws SmackException, InterruptedException, IOException, XMPPException {
    final Protocol protocol = new Protocol();
    final XMPPConnection connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID);
    final String sessionID = "session_id_shouldBlacklistNonSocks5Proxies";
    // get Socks5ByteStreamManager for connection
    Socks5BytestreamManager byteStreamManager = Socks5BytestreamManager.getBytestreamManager(connection);
    byteStreamManager.setAnnounceLocalStreamHost(false);
    /**
     * create responses in the order they should be queried specified by the XEP-0065
     * specification
     */
    // build discover info that supports the SOCKS5 feature
    DiscoverInfoBuilder discoverInfoBuilder = Socks5PacketUtils.createDiscoverInfo(targetJID, initiatorJID);
    discoverInfoBuilder.addFeature(Bytestream.NAMESPACE);
    DiscoverInfo discoverInfo = discoverInfoBuilder.build();
    // return that SOCKS5 is supported if target is queried
    protocol.addResponse(discoverInfo, Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build discover items containing a proxy item
    DiscoverItems discoverItems = Socks5PacketUtils.createDiscoverItems(xmppServer, initiatorJID);
    Item item = new Item(proxyJID);
    discoverItems.addItem(item);
    // return the proxy item if XMPP server is queried
    protocol.addResponse(discoverItems, Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build discover info for proxy containing information about NOT being a Socks5
    // proxy
    DiscoverInfoBuilder proxyInfo = Socks5PacketUtils.createDiscoverInfo(proxyJID, initiatorJID);
    Identity identity = new Identity("noproxy", proxyJID.toString(), "bytestreams");
    proxyInfo.addIdentity(identity);
    // return the proxy identity if proxy is queried
    protocol.addResponse(proxyInfo.build(), Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    SmackException e = assertThrows(SmackException.class, () -> {
        // start SOCKS5 Bytestream
        byteStreamManager.establishSession(targetJID, sessionID);
        fail("exception should be thrown");
    });
    protocol.verifyAll();
    assertTrue(e.getMessage().contains("no SOCKS5 proxies available"));
    /* retry to establish SOCKS5 Bytestream */
    // add responses for service discovery again
    protocol.addResponse(discoverInfo, Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    protocol.addResponse(discoverItems, Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    e = assertThrows(SmackException.class, () -> {
        // start SOCKS5 Bytestream
        byteStreamManager.establishSession(targetJID, sessionID);
    });
    /*
         * #verifyAll() tests if the number of requests and responses corresponds and should
         * fail if the invalid proxy is queried again
         */
    protocol.verifyAll();
    assertTrue(e.getMessage().contains("no SOCKS5 proxies available"));
}
Also used : DiscoverInfo(org.jivesoftware.smackx.disco.packet.DiscoverInfo) Item(org.jivesoftware.smackx.disco.packet.DiscoverItems.Item) DiscoverInfoBuilder(org.jivesoftware.smackx.disco.packet.DiscoverInfoBuilder) SmackException(org.jivesoftware.smack.SmackException) DiscoverItems(org.jivesoftware.smackx.disco.packet.DiscoverItems) XMPPConnection(org.jivesoftware.smack.XMPPConnection) Protocol(org.jivesoftware.util.Protocol) Identity(org.jivesoftware.smackx.disco.packet.DiscoverInfo.Identity) Test(org.junit.jupiter.api.Test)

Example 4 with Item

use of org.jivesoftware.smackx.disco.packet.DiscoverItems.Item in project Smack by igniterealtime.

the class Socks5ByteStreamManagerTest method shouldFailIfInitiatorCannotConnectToSocks5Proxy.

/**
 * Invoking {@link Socks5BytestreamManager#establishSession(org.jxmpp.jid.Jid, String)} should fail if
 * initiator can not connect to the SOCKS5 proxy used by target.
 *
 * @throws InterruptedException if the calling thread was interrupted.
 * @throws SmackException if Smack detected an exceptional situation.
 * @throws XMPPException if an XMPP protocol error was received.
 * @throws XmppStringprepException if the provided string is invalid.
 */
@Test
public void shouldFailIfInitiatorCannotConnectToSocks5Proxy() throws SmackException, InterruptedException, XMPPException, XmppStringprepException {
    final Protocol protocol = new Protocol();
    final XMPPConnection connection = ConnectionUtils.createMockedConnection(protocol, initiatorJID);
    final String sessionID = "session_id_shouldFailIfInitiatorCannotConnectToSocks5Proxy";
    // TODO: The following two variables should be named initatorProxyJid and initiatorProxyAddress.
    final DomainBareJid proxyJID = JidCreate.domainBareFrom("s5b-proxy.initiator.org");
    // Use an TEST-NET-1 address from RFC 5737 to act as black hole.
    final String proxyAddress = "192.0.2.1";
    // get Socks5ByteStreamManager for connection
    Socks5BytestreamManager byteStreamManager = Socks5BytestreamManager.getBytestreamManager(connection);
    byteStreamManager.setAnnounceLocalStreamHost(false);
    byteStreamManager.setProxyConnectionTimeout(3000);
    /**
     * create responses in the order they should be queried specified by the XEP-0065
     * specification
     */
    // build discover info that supports the SOCKS5 feature
    DiscoverInfoBuilder discoverInfoBuilder = Socks5PacketUtils.createDiscoverInfo(targetJID, initiatorJID);
    discoverInfoBuilder.addFeature(Bytestream.NAMESPACE);
    // return that SOCKS5 is supported if target is queried
    protocol.addResponse(discoverInfoBuilder.build(), Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build discover items containing a proxy item
    DiscoverItems discoverItems = Socks5PacketUtils.createDiscoverItems(xmppServer, initiatorJID);
    Item item = new Item(proxyJID);
    discoverItems.addItem(item);
    // return the proxy item if XMPP server is queried
    protocol.addResponse(discoverItems, Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build discover info for proxy containing information about being a SOCKS5 proxy
    DiscoverInfoBuilder proxyInfo = Socks5PacketUtils.createDiscoverInfo(proxyJID, initiatorJID);
    Identity identity = new Identity("proxy", proxyJID.toString(), "bytestreams");
    proxyInfo.addIdentity(identity);
    // return the socks5 bytestream proxy identity if proxy is queried
    protocol.addResponse(proxyInfo.build(), Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build a socks5 stream host info containing the address and the port of the
    // proxy
    Bytestream streamHostInfo = Socks5PacketUtils.createBytestreamResponse(proxyJID, initiatorJID);
    streamHostInfo.addStreamHost(proxyJID, proxyAddress, 7778);
    // return stream host info if it is queried
    protocol.addResponse(streamHostInfo, Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build used stream host response
    Bytestream streamHostUsedPacket = Socks5PacketUtils.createBytestreamResponse(targetJID, initiatorJID);
    streamHostUsedPacket.setSessionID(sessionID);
    streamHostUsedPacket.setUsedHost(proxyJID);
    // return used stream host info as response to the bytestream initiation
    protocol.addResponse(streamHostUsedPacket, new Verification<Bytestream, Bytestream>() {

        @Override
        public void verify(Bytestream request, Bytestream response) {
            // verify SOCKS5 Bytestream request
            assertEquals(response.getSessionID(), request.getSessionID());
            assertEquals(1, request.getStreamHosts().size());
            StreamHost streamHost = (StreamHost) request.getStreamHosts().toArray()[0];
            assertEquals(response.getUsedHost().getJID(), streamHost.getJID());
        }
    }, Verification.correspondingSenderReceiver, Verification.requestTypeSET);
    IOException e = assertThrows(IOException.class, () -> {
        // start SOCKS5 Bytestream
        byteStreamManager.establishSession(targetJID, sessionID);
    });
    // initiator can't connect to proxy because it is not running
    protocol.verifyAll();
    Throwable actualCause = e.getCause();
    assertEquals(TimeoutException.class, actualCause.getClass(), "Unexpected throwable: " + actualCause + '.' + ExceptionUtil.getStackTrace(actualCause));
}
Also used : DiscoverInfoBuilder(org.jivesoftware.smackx.disco.packet.DiscoverInfoBuilder) DiscoverItems(org.jivesoftware.smackx.disco.packet.DiscoverItems) XMPPConnection(org.jivesoftware.smack.XMPPConnection) IOException(java.io.IOException) Item(org.jivesoftware.smackx.disco.packet.DiscoverItems.Item) Bytestream(org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream) Protocol(org.jivesoftware.util.Protocol) Identity(org.jivesoftware.smackx.disco.packet.DiscoverInfo.Identity) DomainBareJid(org.jxmpp.jid.DomainBareJid) StreamHost(org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream.StreamHost) Test(org.junit.jupiter.api.Test)

Example 5 with Item

use of org.jivesoftware.smackx.disco.packet.DiscoverItems.Item in project Smack by igniterealtime.

the class Socks5ByteStreamManagerTest method createResponses.

private static void createResponses(Protocol protocol, String sessionID, Verification<Bytestream, Bytestream> streamHostUsedVerification, Socks5TestProxy socks5TestProxy) throws XmppStringprepException {
    // build discover info that supports the SOCKS5 feature
    DiscoverInfoBuilder discoverInfo = Socks5PacketUtils.createDiscoverInfo(targetJID, initiatorJID);
    discoverInfo.addFeature(Bytestream.NAMESPACE);
    // return that SOCKS5 is supported if target is queried
    protocol.addResponse(discoverInfo.build(), Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build discover items containing a proxy item
    DiscoverItems discoverItems = Socks5PacketUtils.createDiscoverItems(xmppServer, initiatorJID);
    discoverItems.addItem(new Item(JidCreate.from("proxy2.xmpp-server")));
    discoverItems.addItem(new Item(proxyJID));
    // return the proxy item if XMPP server is queried
    protocol.addResponse(discoverItems, Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    /*
         * build discover info for proxy "proxy2.xmpp-server" containing information about being a
         * SOCKS5 proxy
         */
    DiscoverInfoBuilder proxyInfo1 = Socks5PacketUtils.createDiscoverInfo(JidCreate.from("proxy2.xmpp-server"), initiatorJID);
    Identity identity1 = new Identity("proxy", "proxy2.xmpp-server", "bytestreams");
    proxyInfo1.addIdentity(identity1);
    // return the SOCKS5 bytestream proxy identity if proxy is queried
    protocol.addResponse(proxyInfo1.build(), Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build discover info for proxy containing information about being a SOCKS5 proxy
    DiscoverInfoBuilder proxyInfo2 = Socks5PacketUtils.createDiscoverInfo(proxyJID, initiatorJID);
    Identity identity2 = new Identity("proxy", proxyJID.toString(), "bytestreams");
    proxyInfo2.addIdentity(identity2);
    // return the SOCKS5 bytestream proxy identity if proxy is queried
    protocol.addResponse(proxyInfo2.build(), Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    /*
         * build a SOCKS5 stream host info for "proxy2.xmpp-server" containing the address and the
         * port of the proxy
         */
    Bytestream streamHostInfo1 = Socks5PacketUtils.createBytestreamResponse(JidCreate.from("proxy2.xmpp-server"), initiatorJID);
    streamHostInfo1.addStreamHost(JidCreate.from("proxy2.xmpp-server"), proxyAddress, socks5TestProxy.getPort());
    // return stream host info if it is queried
    protocol.addResponse(streamHostInfo1, Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build a SOCKS5 stream host info containing the address and the port of the proxy
    Bytestream streamHostInfo2 = Socks5PacketUtils.createBytestreamResponse(proxyJID, initiatorJID);
    streamHostInfo2.addStreamHost(proxyJID, proxyAddress, socks5TestProxy.getPort());
    // return stream host info if it is queried
    protocol.addResponse(streamHostInfo2, Verification.correspondingSenderReceiver, Verification.requestTypeGET);
    // build used stream host response
    Bytestream streamHostUsedPacket = Socks5PacketUtils.createBytestreamResponse(targetJID, initiatorJID);
    streamHostUsedPacket.setSessionID(sessionID);
    streamHostUsedPacket.setUsedHost(proxyJID);
    // return used stream host info as response to the bytestream initiation
    protocol.addResponse(streamHostUsedPacket, streamHostUsedVerification, Verification.correspondingSenderReceiver, Verification.requestTypeSET);
    // build response to proxy activation
    IQ activationResponse = Socks5PacketUtils.createActivationConfirmation(proxyJID, initiatorJID);
    // return proxy activation response if proxy should be activated
    protocol.addResponse(activationResponse, new Verification<Bytestream, IQ>() {

        @Override
        public void verify(Bytestream request, IQ response) {
            assertEquals(targetJID, request.getToActivate().getTarget());
        }
    }, Verification.correspondingSenderReceiver, Verification.requestTypeSET);
}
Also used : Item(org.jivesoftware.smackx.disco.packet.DiscoverItems.Item) Bytestream(org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream) DiscoverInfoBuilder(org.jivesoftware.smackx.disco.packet.DiscoverInfoBuilder) ErrorIQ(org.jivesoftware.smack.packet.ErrorIQ) IQ(org.jivesoftware.smack.packet.IQ) DiscoverItems(org.jivesoftware.smackx.disco.packet.DiscoverItems) Identity(org.jivesoftware.smackx.disco.packet.DiscoverInfo.Identity)

Aggregations

DiscoverItems (org.jivesoftware.smackx.disco.packet.DiscoverItems)9 Item (org.jivesoftware.smackx.disco.packet.DiscoverItems.Item)9 Identity (org.jivesoftware.smackx.disco.packet.DiscoverInfo.Identity)8 XMPPConnection (org.jivesoftware.smack.XMPPConnection)7 DiscoverInfoBuilder (org.jivesoftware.smackx.disco.packet.DiscoverInfoBuilder)7 Bytestream (org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream)6 Protocol (org.jivesoftware.util.Protocol)6 Test (org.junit.jupiter.api.Test)6 ErrorIQ (org.jivesoftware.smack.packet.ErrorIQ)4 IQ (org.jivesoftware.smack.packet.IQ)4 SmackException (org.jivesoftware.smack.SmackException)3 DiscoverInfo (org.jivesoftware.smackx.disco.packet.DiscoverInfo)3 XMPPErrorException (org.jivesoftware.smack.XMPPException.XMPPErrorException)2 StreamHost (org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream.StreamHost)2 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 OutputStream (java.io.OutputStream)1 ServerSocket (java.net.ServerSocket)1 ArrayList (java.util.ArrayList)1 NoResponseException (org.jivesoftware.smack.SmackException.NoResponseException)1