Commit bc8f141b authored by Dietmar Maurer's avatar Dietmar Maurer

do not use keep_alive for connections to localhost

parent 4c06bd34
...@@ -248,8 +248,11 @@ sub proxy_request { ...@@ -248,8 +248,11 @@ sub proxy_request {
eval { eval {
my $target; my $target;
my $keep_alive = 1;
if ($host eq 'localhost') { if ($host eq 'localhost') {
$target = "http://$host:85$abs_uri"; $target = "http://$host:85$abs_uri";
# keep alive for localhost is not worth (connection setup is about 0.2ms)
$keep_alive = 0;
} else { } else {
$target = "https://$host:8006$abs_uri"; $target = "https://$host:8006$abs_uri";
} }
...@@ -283,6 +286,7 @@ sub proxy_request { ...@@ -283,6 +286,7 @@ sub proxy_request {
headers => $headers, headers => $headers,
timeout => 30, timeout => 30,
recurse => 0, recurse => 0,
keepalive => $keep_alive,
body => $content, body => $content,
tls_ctx => $self->{tls_ctx}, tls_ctx => $self->{tls_ctx},
sub { sub {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment