Anyone knows how to do it?
I don't see why you couldn't just use this... TOR wrapper or at least adapt that to do what you want.