!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/queuepro/node_modules/browser-sync-ui/lib/plugins/connections/lib/   drwxrwxr-x
Free 13.18 GB of 57.97 GB (22.74%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     connections.js (3.52 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
var Immutable = require("immutable");

/**
 * Track connected clients
 * @param {UI} ui
 * @param {BrowserSync} bs
 */
module.exports.init = function (ui, bs) {

    var uaParser = new bs.utils.UAParser();

    var currentConnections = [];

    ui.clients.on("connection", function (client) {
        client.on("client:heartbeat", function (data) {
            var match;
            if (currentConnections.some(function (item, index) {
                    if (item.id === client.id) {
                        match = index;
                        return true;
                    }
                    return false;
                })) {
                if (typeof match === "number") {
                    currentConnections[match].timestamp = new Date().getTime();
                    currentConnections[match].data = data;
                }
            } else {
                currentConnections.push({
                    id: client.id,
                    timestamp: new Date().getTime(),
                    browser: uaParser.setUA(client.handshake.headers["user-agent"]).getBrowser(),
                    data: data
                });
            }
        });
    });

    var registry;
    var temp;
    var initialSent;

    var int = setInterval(function () {

        var sockets = ui.clients.sockets;
        var keys = Object.keys(sockets);

        if (keys.length) {
            temp = Immutable.List(keys.map(function (clientKey) {
                var currentClient = sockets[clientKey];
                return Immutable.fromJS({
                    id: currentClient.id,
                    browser: uaParser.setUA(currentClient.handshake.headers["user-agent"]).getBrowser()
                });
            }));
            if (!registry) {
                registry = temp;
                sendUpdated(ui.socket, decorateClients(registry.toJS(), currentConnections));
            } else {
                if (Immutable.is(registry, temp)) {
                    if (!initialSent) {
                        sendUpdated(ui.socket, decorateClients(registry.toJS(), currentConnections));
                        initialSent = true;
                    }
                } else {
                    registry = temp;
                    sendUpdated(ui.socket, decorateClients(registry.toJS(), currentConnections));
                }
            }
        } else {
            sendUpdated(ui.socket, []);
        }

    }, 1000);

    bs.registerCleanupTask(function () {
        clearInterval(int);
    });
};


/**
 * Use heart-beated data to decorate clients
 * @param clients
 * @param clientsInfo
 * @returns {*}
 */
function decorateClients(clients, clientsInfo) {
    return clients.map(function (item) {
        clientsInfo.forEach(function (client) {
            if (client.id === item.id) {
                item.data = client.data;
                return false;
            }
        });
        return item;
    });
}

/**
 * @param socket
 * @param connectedClients
 */
function sendUpdated(socket, connectedClients) {
    socket.emit("ui:connections:update", connectedClients);
}

/**
 * @param clients
 * @param data
 */
//function highlightClient (clients, data) {
//    var socket = getClientById(clients, data.id);
//    if (socket) {
//        socket.emit("highlight");
//    }
//}

/**
 * @param clients
 * @param id
 */
//function getClientById (clients, id) {
//    var match;
//    clients.sockets.some(function (item, i) {
//        if (item.id === id) {
//            match = clients.sockets[i];
//            return true;
//        }
//    });
//    return match;
//}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0328 ]--