Code Monkey home page Code Monkey logo

Comments (4)

karalabe avatar karalabe commented on June 6, 2024

I honestly haven't the slightest clue what might be wrong, but this is a use case I want to actively use myself too in the following days, so I'll get back to you if I figure anything out.

from go-libtor.

karalabe avatar karalabe commented on June 6, 2024

Just hit this myself too. Funky, will try to figure it out. Seems that the tor bootstrap never finishes when restarting. At least it never gives back control to the caller, even though it says "100%" booted. I've tried nuking the datadir and restarting like that and it also doesn't seem to work, so it might be something off either in the lib or in the control lib.

from go-libtor.

karalabe avatar karalabe commented on June 6, 2024

I think the (or an) issue is in the controller lib: https://github.com/cretz/bine/blob/62912bff1c531f4cb731cc86d38e78bc94aea2fd/tor/tor.go#L370

Onion creation uses tor.EnableNetwork(ctx, true), blocking until the circuit bootstraps itself. However, if the network was enabled already, the above line bail out of the method, even if waiting was requested and the circuit is not yet done. Not sure if this is the cause for the hang, but it's a weird race. Will try to fix and see.

from go-libtor.

karalabe avatar karalabe commented on June 6, 2024

I knew until now that the Tor library is not capable of running two instances in the same process. Unfortunately it also seems that it's not capable of restarting itself without restarting the entire process. My hunch is that some global variable is ruined on shutdown.

Either way, Tor does support enabling and siabling networking, so you can get away with not killing the in-process Tor, just shutting the network off and back on and it should work:

You can enable networking on request via.

tor.EnableNetwork(context.Background(), false)

Turning off the networking is not exposed in the bine library, but you can do it via:

tor.Control.SetConf(control.KeyVals("DisableNetwork", "1")...)

The lack of the latter is tracked in cretz/bine#41

from go-libtor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.