Giter VIP home page Giter VIP logo

go-libp2p-tor-transport's Introduction

go-libp2p-tor-transport

Go tor transport is a go-libp2p transport targeting mainly *nix platform.

WIP

This transport is in very early stages (PoC) many of features enumerated here are just targets we think we can acheive.

You can follow the process of the 1.0 here.

Usage :

import (
  "context"

  tor "berty.tech/go-libp2p-tor-transport"
  libp2p "github.com/libp2p/go-libp2p"
)

func main() {
  builder, err := tor.NewBuilder() // Create a builder
  c(err)
  host, err := libp2p.New(         // Create a libp2p node
    context.Background(),
    libp2p.Transport(builder),     // Use the builder to create a transport instance (you can't reuse the same builder after that).
  )
  c(err)
}

func c(err error) { // Used to check error in this example, replace by whatever you want.
  if err != nil {
    panic(err)
  }
}

With config :

import (
  "context"
  "time"

  tor "berty.tech/go-libp2p-tor-transport"
  config "berty.tech/go-libp2p-tor-transport/config"
  libp2p "github.com/libp2p/go-libp2p"
)

func main() {
  builder, err := tor.NewBuilder(       // NewBuilder can accept some `config.Configurator`
    config.AllowTcpDial                 // Some Configurator are already ready to use.
    config.SetSetupTimeout(time.Minute) // Some require a parameter, in this case it's a function that will return a Configurator.
  )
  // Evrything else is as previously shown.
  c(err)
  hostWithConfig, err := libp2p.New(
    context.Background(),
    libp2p.Transport(builder),
  )
  c(err)
}

func c(err error) {
  if err != nil {
    panic(err)
  }
}

Support

This transport target *nix (Linux, OSX, IOS, Android, ...), it also can be built for windows but many of the attack reduction mesures will not be present (on windows potentialy un encrypted traffic will transit through the loopback, also some tor control port are gonna be exposed.).

Tor Provider Compatibility

You can use 3 different provider :

  • Embeded, this transport naturaly include a tor build, nothing to do.
  • External node, the transport will connect to an already running tor node (usefull for server, can increase annonymity by running a relay at the same time blocking SCA attacks).
  • File Path, you can give a path to a tor node executable, the transport will start the node and setup it.

Running Mode

  • Compatibility, this will create tunnels only 1 or 0 long, this disable privacy protection but allows to connect or be contacted by annonym nodes at a much lower cost (you can also use that to go around your nat) default.
  • Annonymity, this will works like you expect 3 hop tunnels, in combination with a correct configuration of your libp2p node you will be able to also dial non annonym nodes through an exit relay.

go-libp2p-tor-transport's People

Contributors

jorropo avatar

Watchers

 avatar

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.