Create a gist now

Instantly share code, notes, and snippets.

anonymous /gist:42c32258713b34f3604e Secret
Created Jul 31, 2012

What would you like to do?
use Mojo::UserAgent;
use Mojo::Server::Daemon;
my $ua = Mojo::UserAgent->new();
my $daemon = Mojo::Server::Daemon->new(listen => ['https://*:443'])->unsubscribe('request');
$daemon->on(request => sub {
my ($daemon, $tx) =@_;
my $req = $tx->req->clone();
$ua->start(Mojo::Transaction::HTTP->new(req => $req) => sub {
my ($ua, $proxy_tx) = @_;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment