I like the concept of being able to add to the list of supported schemes without having to modify the Proxy.pm. Adding 'proxy' to the list of protocols allowed seems to work OK using this code:
CPAN::Forum
HTTP-Proxy - Re: Suggestion for mutator to convert unknown schemes
| Posted on Sun Aug 14 13:22:19 2005 by bblakley in response to 885 (See the whole thread of 8) |
| Re: Suggestion for mutator to convert unknown schemes |
|
I like the concept of being able to add to the list of supported schemes without having to modify the Proxy.pm. Adding 'proxy' to the list of protocols allowed seems to work OK using this code:
my $proxy = HTTP::Proxy->new( port => 8080, host => '', via => 'HoTTProxy' );
$proxy->init();
$proxy->agent->protocols_allowed( [ @{ $proxy->agent->protocols_allowed() }, 'proxy' ] );
I had to add the $proxy->init() because Proxy.pm was saying:
Can't call method "protocols_allowed" on an undefined value at C:\HoTTProxy\HoTTProxy.pl line 112.
if I didn't. However, even after getting it to take the additional "allowed" protocol, the filter is dying with this error, and I don't know why:
Unsupported scheme: proxy at C:\HoTTProxy\HoTTProxy.pl line 125
I tried reading the code around line 630 in Proxy.pm but can't see why it should think that scheme 'proxy' is unsupported once it is added to protocols_allowed. Just to ensure that 'proxy' really was in protocols_allowed, I even tried just hard coding it into the list in line 225 of Proxy.pm, and I still get the same "unsupported scheme" error. Stumped for now. I think I should go to bed. It will be light soon. |
| Direct Responses: 887 | Write a response |
(3)
]