libp2p-vpn

command
v0.0.0-...-f180c14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 11 Imported by: 0

README

Simple VPN with go-libp2p-vpn

This is an example that quickly shows how to use the go-libp2p-vpn stack.

The app will start a local TUN interface and wait for a connection to the peer on the /vpn/tun/1.0.0 protocol.

After connecting, the VPN is fully established.

Build

From the libp2p-vpn directory run the following:

> cd libp2p-vpn
> go build

Usage

First create two private keys, it will print the respective peer IDs:

$ ./libp2p-vpn keygen -f peer1
peer ID: Qm..Ana
$ ./libp2p-vpn keygen -f peer2
peer ID: Qm..Bob

On Mac, in a terminal do:

$ sudo ./libp2p-vpn run \
    -f peer1 \
    -l /ip4/127.0.0.1/tcp/10000 \
    -p /ip4/127.0.0.1/tcp/10001/p2p/Qm..Bob \
    -t 10.0.0.1,10.0.0.2

then from another terminal:

$ sudo ./libp2p-vpn run \
    -f peer2 \
    -l /ip4/127.0.0.1/tcp/10001 \
    -p /ip4/127.0.0.1/tcp/10000/p2p/Qm..Ana \
    -t 10.0.0.2,10.0.0.1

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL