Rewrite of torsocks 1.3