Yesterday I installed danted
http://www.inet.no/dante/, a socks server.
I used the minimal config, allowed "local" clients to connect without passwd and set the external host to ppp0.
Then, I set up deluged to use it as proxy and it seems to work well, except I don't see any dht nodes.
When the vpn goes down. deluge stops up/downloading. When the vpn goes back up, it restarts - after a while.
I have read that you can setup ssh to run as a socks proxy server (with -N -D pars), and this would be an elegant solution if only there was a way to make ssh "blindly" forward the packets to/from the vpn tunnel without logging in to an external host. But it seems ssh needs login to do this... Maybe someone else has a solution to this. It shouldn't be necessary to install a separate socks server when ssh has (some of) this capabilities.
//jxx