noisysockets

package module
v0.23.3 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MPL-2.0 Imports: 21 Imported by: 7

README

Noisy Sockets

Noisy Sockets is a secure service-to-service communications library based on the Noise Protocol Framework. Endpoints are identified by Curve25519 public keys, traffic is encrypted and authenticated using ChaCha20-Poly1305, and sent/received as UDP packets. Noisy Sockets is wire compatible with WireGuard.

Noisy Sockets implements a drop-in replacement for the Go net package, allowing it to be used with any existing code. This is implemented using a userspace TCP/IP stack based on Netstack from the gVisor project.

Usage

Examples of how to use Noisy Sockets can be found in the examples directory.

Performance

Surprisingly decent, I've been able to saturate a 1Gbps link with approximately two CPU cores and a single noisy socket. Interestingly it appears to outperform the kernel implementation of WireGuard.

Some preliminary benchmark results can be found in the benchmarks respository.

Credits

Noisy Sockets is based on code originally from the wireguard-go project by Jason A. Donenfeld.

WireGuard is a registered trademark of Jason A. Donenfeld.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownPeer = errors.New("unknown peer")
)

Functions

This section is empty.

Types

type NoisySocketsNetwork added in v0.10.0

type NoisySocketsNetwork struct {
	*network.UserspaceNetwork
	// contains filtered or unexported fields
}

NoisySocketsNetwork is a wrapper around a userspace WireGuard peer.

func OpenNetwork added in v0.18.0

func OpenNetwork(logger *slog.Logger, conf *latestconfig.Config) (*NoisySocketsNetwork, error)

OpenNetwork creates a new network using the provided configuration. The returned network is a userspace WireGuard peer that exposes Dial() and Listen() methods compatible with the net package.

func (*NoisySocketsNetwork) AddPeer added in v0.15.0

func (net *NoisySocketsNetwork) AddPeer(peerConf latestconfig.PeerConfig) error

AddPeer adds a wireguard peer to the network.

func (*NoisySocketsNetwork) AddRoute added in v0.15.0

func (net *NoisySocketsNetwork) AddRoute(routeConf *latestconfig.RouteConfig) error

AddRoute adds a route to the network.

func (*NoisySocketsNetwork) Close added in v0.10.0

func (net *NoisySocketsNetwork) Close() error

Close closes the network.

func (*NoisySocketsNetwork) RemovePeer added in v0.15.0

func (net *NoisySocketsNetwork) RemovePeer(publicKey types.NoisePublicKey) error

RemovePeer removes a wireguard peer from the network.

Directories

Path Synopsis
benchmark module
examples module
internal
conn
Package conn implements WireGuard's network connections.
Package conn implements WireGuard's network connections.
replay
Package replay implements an efficient anti-replay algorithm as specified in RFC 6479.
Package replay implements an efficient anti-replay algorithm as specified in RFC 6479.

Jump to

Keyboard shortcuts

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