A library providing an ACN (Anonymous Communication Network) abstraction and a tor (for now) implementation.
Go to file
Sarah Jamie Lewis 1524e78a4a
continuous-integration/drone/push Build is pending Details
Merge pull request 'Clarified and Split Apart Environment Variables that alter port binding behaviour.' (#47) from whonix into master
Reviewed-on: #47
Reviewed-by: Dan Ballard <dan@openprivacy.ca>
2023-08-18 21:03:41 +00:00
testing drone use go 1.19.1 2022-10-08 15:26:39 -07:00
tor Expand Useable Ports...these apply to hosted servers too.. 2023-08-16 10:56:43 -07:00
.drone.yml drone use go 1.19.1 2022-10-08 15:26:39 -07:00
.gitignore Fix errorAcn reference issues + add support for Tor specific shared library path 2023-05-24 11:11:18 -07:00
LICENSE import libricochet-go connectivity package as stand alone repo 2020-02-05 19:46:02 -05:00
README.md Update Docs 2023-08-16 10:59:31 -07:00
acn.go Get x Callbacks 2022-08-08 12:24:16 -07:00
error_acn.go Require error to construct an ErrorACN 2023-05-29 10:22:36 -07:00
go.mod Upgrade Bine 2023-04-05 02:38:26 +00:00
go.sum Upgrade Bine 2023-04-05 02:38:26 +00:00
localProvider.go Get x Callbacks 2022-08-08 12:24:16 -07:00
proxy_acn.go Get x Callbacks 2022-08-08 12:24:16 -07:00

README.md

connectivity

A library providing an ACN (Anonymous Communication Network ) networking abstraction

Supported ACNs

  • Tor v3 Onion Services

Environment Variables

  • TOR_LD_LIBRARY_PATH - override the library path given to the Tor process as different from the one given to the parent process.
  • CWTCH_RESTRICT_PORTS - forces connectivity to bind to a subset of ports 15000-15378
  • CWTCH_BIND_EXTERNAL_WHONIX - forces connectivity to bind to external interfaces (only supported/recommended on certain Whonix-based setups. Please open an issue if you think this should be expanded.)

Requirements for ACN Support

  • Reference an EndPoint via a string / hostname
  • Maintain an endpoint via a PublicKey (the underlying crypto is the responsibility of the implementation)

Using

Each ACN implementation provides a specific start function that takes in the required parameters to e.g. find a specific binary on the system, attempt to talk to a specific system service or launch an in-memory networking manager:

    acn, err := NewTorACN(".", "", 9051, HashedPasswordAuthenticator{"examplehasedpassword"})
    if err != nil {
        t.Error(err)
        return
    }

At this point the ACN is responsible for setting up the networking interface, the result of which can be checked via the Status callback:

    acn.SetStatusCallback(getStatusCallback(progChan))

    progress := 0
    for progress < 100 {
        progress = <-progChan
    }

Once initialized the ACN can be used to open new connections:

    conn,err := acn.Open(hostname);

Or host a service on the ACN:

    ls,err := acn.Listen(identity, port) ;

We also provide closing and restart functionality for managing the networking service:

    acn.Restart()

and

    acn.Close()