To browse the web, I connect to ssh and make a tunnel to an http proxy (privoxy) who is configured to "route" the traffic depending on the extension, here is an extract of the privoxy config file :
forward .i2p localhost:4444
forward-socks5 / 127.0.0.1:9050 .
basically, if the domain ends with ".i2p" it forwards the traffic to i2p and forward it to tor otherwise.
So in Firefox I configure an http proxy (through a local port forwarding) BUT in these case it seems that I have a DNS leak and there is no obvious solution, so my question is:
If I configure firefox with a socks proxy instead of an http proxy how can I write flexible rules to "route" the traffic to i2p, Tor, or eventually direct traffic (like my previous privoxy config)?