Skip to content

anonymous /gist:42c32258713b34f3604e secret
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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();
$req->url->scheme("https")->host("10.3.199.40");
$ua->start(Mojo::Transaction::HTTP->new(req => $req) => sub {
my ($ua, $proxy_tx) = @_;
$tx->res($proxy_tx->res)->resume();
});
});
$daemon->run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.