Package org.jivesoftware.smackx.bytestreams.socks5

Examples of org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamSession


     * Returns a SOCKS5 Bytestream activation packet.
     *
     * @return SOCKS5 Bytestream activation packet
     */
    private Bytestream createStreamHostActivation() {
        Bytestream activate = new Bytestream(this.sessionID);
        activate.setMode(null);
        activate.setType(IQ.Type.SET);
        activate.setTo(this.streamHost.getJID());

        activate.setToActivate(this.target);

        return activate;
    }
View Full Code Here


        if (selectedHost == null || socket == null) {
            cancelRequest();
        }

        // send used-host confirmation
        Bytestream response = createUsedHostResponse(selectedHost);
        this.manager.getConnection().sendPacket(response);

        return new Socks5BytestreamSession(socket, selectedHost.getJID().equals(
                        this.bytestreamRequest.getFrom()));
View Full Code Here

     *
     * @param selectedHost the used SOCKS5 proxy
     * @return the response to the SOCKS5 Bytestream request
     */
    private Bytestream createUsedHostResponse(StreamHost selectedHost) {
        Bytestream response = new Bytestream(this.bytestreamRequest.getSessionID());
        response.setTo(this.bytestreamRequest.getFrom());
        response.setType(IQ.Type.RESULT);
        response.setPacketID(this.bytestreamRequest.getPacketID());
        response.setUsedHost(selectedHost.getJID());
        return response;
    }
View Full Code Here

            }
        });
    }

    private void processRequest(Packet packet) {
        Bytestream byteStreamRequest = (Bytestream) packet;

        // ignore request if in ignore list
        if (this.manager.getIgnoredBytestreamRequests().remove(byteStreamRequest.getSessionID())) {
            return;
        }

        // build bytestream request from packet
        Socks5BytestreamRequest request = new Socks5BytestreamRequest(this.manager,
                        byteStreamRequest);

        // notify listeners for bytestream initiation from a specific user
        BytestreamListener userListener = this.manager.getUserListener(byteStreamRequest.getFrom());
        if (userListener != null) {
            userListener.incomingBytestreamRequest(request);

        }
        else if (!this.manager.getAllRequestListeners().isEmpty()) {
View Full Code Here

        protocol.addResponse(proxyInfo, 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);
View Full Code Here

        protocol.addResponse(proxyInfo, 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("invalid.proxy");

        // return used stream host info as response to the bytestream initiation
        protocol.addResponse(streamHostUsedPacket, Verification.correspondingSenderReceiver,
                        Verification.requestTypeSET);
View Full Code Here

        // start thread to connect to SOCKS5 proxy
        Thread serverThread = new Thread() {

            @Override
            public void run() {
                StreamHost streamHost = new StreamHost(proxyJID, serverAddress);
                streamHost.setPort(serverPort);

                Socks5Client socks5Client = new Socks5Client(streamHost, digest);

                try {
View Full Code Here

        // start thread to connect to SOCKS5 proxy
        Thread serverThread = new Thread() {

            @Override
            public void run() {
                StreamHost streamHost = new StreamHost(proxyJID, serverAddress);
                streamHost.setPort(serverPort);

                Socks5Client socks5Client = new Socks5Client(streamHost, digest);
                try {
                    socks5Client.getSocket(10000);
View Full Code Here

        // start thread to connect to SOCKS5 proxy
        Thread serverThread = new Thread() {

            @Override
            public void run() {
                StreamHost streamHost = new StreamHost(proxyJID, serverAddress);
                streamHost.setPort(serverPort);

                Socks5Client socks5Client = new Socks5Client(streamHost, digest);
                try {
                    socks5Client.getSocket(10000);
View Full Code Here

        // start thread to connect to SOCKS5 proxy
        Thread serverThread = new Thread() {

            @Override
            public void run() {
                StreamHost streamHost = new StreamHost(proxyJID, serverAddress);
                streamHost.setPort(serverPort);

                Socks5Client socks5Client = new Socks5Client(streamHost, digest);

                try {
                    Socket socket = socks5Client.getSocket(10000);
View Full Code Here

TOP

Related Classes of org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamSession

Copyright © 2018 www.massapicom. 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.