I think it could be very helpful if aria could gain libproxy support. aria2c already has support for proxy connection, which is great.
Just the 'what' proxy to use is much to restricted.
Libproxy IS the solution for you:
Your project can gain immediately all the support for proxy querying (attention: the scope of libproxy is proxy configuration, not proxy connection).
For further information feel free to check http://libproxy.googlecode.com or also feel free to contact us in irc://irc.freenode.net/#libproxy