diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-02-09 13:56:33 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-02-09 13:56:33 +0100 |
commit | e403f10952ae923d9b7acd4ea8694c7854c5601b (patch) | |
tree | 736c5846ef778a59ea155cbb8c92dd6d8f81d463 /lib/Travel/Status/DE/HAFAS.pm | |
parent | 520e11a25e0c970cc0382af4bfb3565a9ced96fa (diff) |
Add support for service-specific proxies
Diffstat (limited to 'lib/Travel/Status/DE/HAFAS.pm')
-rw-r--r-- | lib/Travel/Status/DE/HAFAS.pm | 7 |
1 files changed, 7 insertions, 0 deletions
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; } |