okkur / torproxy

Caddy plugin to enable easy web to tor proxying
https://torproxy.okkur.org
Apache License 2.0
35 stars 6 forks source link

torproxy on v1 doesn't terminate tor on exit, address already on use #28

Open Raviu56 opened 4 years ago

Raviu56 commented 4 years ago

Is this a BUG REPORT or FEATURE REQUEST?: bug

What happened: When I kill - terminate - caddy with torproxy the spawned tor process doesn't terminate. Which causes caddy to fail on restart as it complains that port 8868 is already is use.

What you expected to happen: I expect it to either end the child tor process, or to be able to re-use an existing one.

Environment:

stp-ip commented 4 years ago

Feels like a similar issue to the one we had before splitting it out into a separate project. Might add some more details for @erbesharat https://github.com/txtdirect/txtdirect/issues/245

erbesharat commented 4 years ago

I used the latest commit on caddy-v1 branch and the Caddy build server binary and after closing torproxy all the opened ports got closed and the Tor instance got shutdown successfully. I had these ports opened after running torproxy with default configs and they all got closed after shutdown:

tcp        0      0 127.0.0.1:4242          0.0.0.0:*               LISTEN      2106/tor            
tcp        0      0 127.0.0.1:8868          0.0.0.0:*               LISTEN      2096/./torproxy     
tcp        0      0 127.0.0.1:43981         0.0.0.0:*               LISTEN      2106/tor            

I wasn't able to reproduce this bug so it would be awesome if you could provide more information and your config file in case you've changed a default config.