Skip to content

Instantly share code, notes, and snippets.

/leak.pl Secret

Created March 13, 2015 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/53a09d0023f170c1a637 to your computer and use it in GitHub Desktop.
Save anonymous/53a09d0023f170c1a637 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;
Mojo::IOLoop->delay(
sub {
my $delay = shift;
$ua->get('http://127.0.0.1:3000' => $delay->begin);
},
sub {
my ($delay, $tx) = @_;
say $tx->res->code;
$ua->get('http://127.0.0.1:3000' => $delay->begin);
},
sub {
my ($delay, $tx) = @_;
say $tx->res->code;
}
)->wait;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment