Skip to content

Instantly share code, notes, and snippets.

@ian-kent
Created January 24, 2014 10:54
Show Gist options
  • Save ian-kent/8595362 to your computer and use it in GitHub Desktop.
Save ian-kent/8595362 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
BEGIN {
$ENV{'HTTP_PROXY'} = '<INSERT PROXY>';
$ENV{'HTTPS_PROXY'} = '<INSERT PROXY>';
$ENV{'MOJO_PROXY'} = 1;
$ENV{'MOJO_USERAGENT_DEBUG'} = 1;
}
use Mojolicious::Lite;
use Data::Dumper;
get '/ua' => sub {
my $self = shift;
$self->ua->post('https://api.github.com' => sub {
my ($ua, $tx) = @_;
print Dumper $tx;
$self->render(status => 200);
});
$self->render_later;
};
get '/curl' => sub {
my $self = shift;
print `curl -v https://api.github.com`;
$self->render(status => 200);
};
app->start;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment