Ok, env_proxy() n'est pas nécessaire (en fait c'est même incompatible avec la méthode $ENV{HTTPS_PROXY}... c'est plutôt pour les autres protocoles ) proxy( 'https' ... ) devrait marcher bien avec les proxy créé avec Apache et mod_proxy, mais pas aussi bien avec d'autres...
Je pense qu'un truc comme ça pourrait marcher :
Mais je n'ai pas l'impression que tout cela marche parfaitement...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 use LWP::UserAgent; my $ua = LWP::UserAgent->new(); $ua->proxy('http', 'http://http:proxy@localhost:9000'); $ENV{HTTPS_PROXY} = 'http://localhost:9000'; $ENV{HTTPS_PROXY_USERNAME} = 'http'; $ENV{HTTPS_PROXY_PASSWORD} = 'proxy'; # create and start the proxy my $proxy = HTTP::Proxy->new(@ARGV, agent => $ua);
--
Jedaï
Partager