Adding alternative hidden service as an option.
This commit is contained in:
parent
5dc5a8b97d
commit
d64d988140
@ -5,5 +5,6 @@
|
|||||||
"database": "example"
|
"database": "example"
|
||||||
},
|
},
|
||||||
"base_url": "https://burguillos.info",
|
"base_url": "https://burguillos.info",
|
||||||
|
"onion_base_url": "http://example.onion";
|
||||||
"listen": "https:localhost:3555"
|
"listen": "https:localhost:3555"
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,18 @@ sub startup ($self) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
$self->hook(
|
||||||
|
before_render => sub($c, $args) {
|
||||||
|
my $onion_base_url = $self->config->{onion_base_url};
|
||||||
|
my $base_url = $self->config->{base_url};
|
||||||
|
if (!defined $onion_base_url) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
my $current_route = $c->url_for;
|
||||||
|
$current_route =~ s/^$base_url//;
|
||||||
|
$c->res->headers->header('Onion-Location' => $onion_base_url.$current_route);
|
||||||
|
}
|
||||||
|
);
|
||||||
my $config = $self->plugin('JSONConfig');
|
my $config = $self->plugin('JSONConfig');
|
||||||
$self->config(
|
$self->config(
|
||||||
hypnotoad => { proxy => 1, listen => [$self->config('listen') // 'http://localhost:3000'] } );
|
hypnotoad => { proxy => 1, listen => [$self->config('listen') // 'http://localhost:3000'] } );
|
||||||
|
Loading…
Reference in New Issue
Block a user