Skip to content

Instantly share code, notes, and snippets.

/leak2.pl Secret

Created March 13, 2015 16:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/7428e08e481e04912ee0 to your computer and use it in GitHub Desktop.
use 5.10.1;
use strict;
use warnings;
use Mojo::IOLoop;
use Mojo::Server::Daemon;
use Mojo::UserAgent;
my $daemon = Mojo::Server::Daemon->new;
$daemon->start;
for my $i (1 .. 100000) {
say $i;
my $ua = Mojo::UserAgent->new;
$ua->get(
'http://127.0.0.1:3000' => sub {
my $tx = pop;
say $tx->res->code;
$ua->get(
'http://127.0.0.1:3000' => sub {
my $tx = pop;
say $tx->res->code;
Mojo::IOLoop->stop;
}
);
}
);
Mojo::IOLoop->start;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment