wherez

package module
v0.0.0-...-fd6418b Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2014 License: Apache-2.0 Imports: 12 Imported by: 0

README

Wherez

Presentation

Wherez (Where Zee) is a p2p program and library that lets you register and discover sibling servers in the network based on a shared passphrase. It uses the Mainline DHT network to advertise its own existence and to look for other nodes that are running with the same passphrase.

It authenticates sibling peers using an HMAC-based mechanism.

Example applications:

  • find the location of your company's doozerd, Chubby or DNS servers.
  • robust way for stolen notebooks to "phone home".
  • register and locate servers in a corporate network based on function, by using different passphrases for the DNS server, LDAP server, etc.

This software is in early stages of development.

This repository contains a library and a command-line tool.

Example CLI usage:

$ cd wherez ; go build
$ ./wherez 8080 "wherezexample"
peer found: 14.15.87.13:3111
peer found: 77.66.77.22:3211
peer found: 16.97.12.12:3312

8080 is your application's port to be advertised to other wherez nodes.

The IP:port pairs that appear are those peers provided by Wherez nodes that have been contacted and authenticated.

Recently started wherez nodes may take several minutes to find other peers and to be found by them.

How does it work?

Presentation: http://goo.gl/vn7Pvh

Documentation

Overview

wherez (Where Zee) lets you register and discover sibling nodes in the network based on a shared passphrase. It uses the Mainline DHT network to advertise its own existence and to look for other nodes that are running with the same passphrase.

Wherez authenticates sibling peers using an HMAC-based mechanism.

Example applications: - find the location of your company's doozerd, Chubby or DNS servers. - robust way for stolen notebooks to "phone home". - register and locate servers in a corporate network based on function, by using different passphrases for the DNS server, LDAP server, etc.

This software is in early stages of development.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAuthenticatedPeers

func FindAuthenticatedPeers(port, appPort, minPeers int, passphrase []byte) chan Peer

FindAuthenticatedPeers uses the BitTorrent DHT network to find sibling Wherez nodes that are using the same passphrase. Wherez will listen on the specified port for both TCP and UDP protocols. The port must be accessible from the public Internet (UPnP is not supported yet).

Wherez will try aggressively to find at least minPeers as fast as possible.

The passphrase will be used to authenticate remote peers. This wherez node will keep running indefinitely as a DHT node.

If appPort is a positive number, wherez will advertise that our main application is on port appPort of the current host. If it's negative, it doesn't announce itself as a peer.

Types

type Challenge

type Challenge struct {
	MagicHeader [6]byte
	Dedupe      [10]byte
	Challenge   [20]byte
}

type Peer

type Peer struct {
	Addr string
}

func (Peer) String

func (p Peer) String() string

type Response

type Response struct {
	Port uint16
	// MAC of the Challenge sent by the client (Alice).
	MAC [32]byte
}

Response containing proof that the server (Bob) knows the shared secret and the application port information required by the client.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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