From e403f10952ae923d9b7acd4ea8694c7854c5601b Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 9 Feb 2025 13:56:33 +0100 Subject: Add support for service-specific proxies --- lib/Travel/Status/DE/HAFAS.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/Travel/Status/DE/HAFAS.pm') diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm index 638b4af..bc274d7 100644 --- a/lib/Travel/Status/DE/HAFAS.pm +++ b/lib/Travel/Status/DE/HAFAS.pm @@ -45,6 +45,13 @@ sub new { if ( $service and $hafas_instance->{$service}{ua_string} ) { $lwp_options{agent} = $hafas_instance->{$service}{ua_string}; } + if ( $service + and my $geoip_service = $hafas_instance->{$service}{geoip_lock} ) + { + if ( my $proxy = $ENV{"HAFAS_PROXY_${geoip_service}"} ) { + $lwp_options{proxy} = [ [ 'http', 'https' ] => $proxy ]; + } + } $ua = LWP::UserAgent->new(%lwp_options); $ua->env_proxy; } -- cgit v1.2.3