Package org.jivesoftware.smackx.bytestreams.socks5

Examples of org.jivesoftware.smackx.bytestreams.socks5.Socks5Proxy.stop()


        proxy.start();

        assertTrue(proxy.isRunning());
        assertEquals(threadCount + 1, Thread.activeCount());

        proxy.stop();

        assertFalse(proxy.isRunning());
        assertEquals(threadCount, Thread.activeCount());

        proxy.start();
View Full Code Here


        proxy.start();

        assertTrue(proxy.isRunning());
        assertEquals(threadCount + 1, Thread.activeCount());

        proxy.stop();

    }

    /**
     * If the SOCKS5 proxy accepts a connection that is not a SOCKS5 connection it should close the
View Full Code Here

        OutputStream out = socket.getOutputStream();
        out.write(new byte[] { 1, 2, 3 });

        assertEquals(-1, socket.getInputStream().read());

        proxy.stop();

    }

    /**
     * The SOCKS5 proxy should reply with an error message if no supported authentication methods
View Full Code Here

        assertEquals((byte) 0x05, (byte) in.read());
        assertEquals((byte) 0xFF, (byte) in.read());

        assertEquals(-1, in.read());

        proxy.stop();

    }

    /**
     * The SOCKS5 proxy should respond with an error message if the client is not allowed to connect
View Full Code Here

        assertEquals((byte) 0x00, (byte) in.read());
        assertEquals((byte) 0x00, (byte) in.read());

        assertEquals(-1, in.read());

        proxy.stop();

    }

    /**
     * A Client should successfully establish a connection to the SOCKS5 proxy.
View Full Code Here

        remoteSocket.close();

        assertEquals(-1, in.read());

        proxy.stop();

    }

    /**
     * Reset SOCKS5 proxy settings.
View Full Code Here

        }
        catch (UnknownHostException e) {
            // ignore
        }

        socks5Proxy.stop();
    }

}
View Full Code Here

            StringBuilder sb = new StringBuilder();
            if (settingsChanged)
                sb.append("Socks5Proxy properties changed. ");

            if (proxy.isRunning()) {
                proxy.stop();
                sb.append("Socks5Proxy stopped. ");
            }
            if (proxyEnabled) {
                proxy.start();
                sb.append("Socks5Proxy started on port " + proxy.getPort()
View Full Code Here

        catch (XMPPException e) {
            assertTrue(e.getMessage().contains("target is not connected to SOCKS5 proxy"));
            protocol.verifyAll(); // assert no XMPP messages were sent
        }

        socks5Proxy.stop();

    }

    /**
     * Initiator and target should successfully connect to the local SOCKS5 proxy.
View Full Code Here

        targetThread.join();

        protocol.verifyAll(); // assert no XMPP messages were sent

        socks5Proxy.removeTransfer(digest);
        socks5Proxy.stop();

    }

    /**
     * If the initiator can connect to a SOCKS5 proxy but activating the stream fails an exception
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.