Subject: | request for alternative proxy syntax |
Would it be possible to also support a syntax that is similar to that of the current AnyEvent::HTTP proxy syntax, i.e. proxy => [$ip, $port]. I would like to be able to do socks => [$ip, $port], or socks5 => [$ip, $port]. Then it would be easier to generalize code instead of having something awkward like this:
my @proxy = $type =~ /^socks5?$/
? (socks => "$type://$ip:$port") : (proxy => [$ip, $port]);
This would be a bit simpler:
my @proxy = ($type =~ /^https?$/ ? 'proxy' : $type => [$ip, $port]);
Even better would be to use exact same proxy syntax if possible and just intercept if the scheme is socks/socks5:
proxy =>[$ip, $port, 'socks'];