Expand description
Rust library providing a set of address data types with minimal dependencies which allow simple use of.
- Tor, Nym, I2P and other mix networks and SOCKS proxies;
- P2P addresses with node public keys.
The crate may be used in a way that prevents using DNS names (outside mixnet scope).
The library is a part of rust cyphernet suite. Cyphernet is a set of libraries for privacy-preserving networking & internet applications.
Network addresses provided by the library include the following types:
InetHost
- IP addr or DNS nameHostName
- IP, DNS, Tor, I2P, Nym host name (no port or proxy information)NetAddr
- any type of host name + port informationPartialAddr
- any type of host name + optional port, which defaults to generic const if not providedPeerAddr
- any of the above addresses + node public key for authenticationProxiedHost
- host name + proxy (there are IP/DNS w/o proxy and with proxy)ProxiedAddr
- any of the above addresses + proxy (thus IP/DNS is always proxied)
The library tries to minimize number of dependencies. Most of its functionality is available via non-default features, like:
mixnets
: supports for mixnet network addresses, includingtor
,nym
,i2p
(may require additional crypto libraries for parsing public keys)serde
: encoding for addresses typesdns
: enable use of DNS names alongside IP addresses and mixnet names.
Modules§
Structs§
- NetAddr
- Partial
Addr - Peer
Addr p2p-ed25519
orp2p-secp256k1
- Proxied
Addr - An address which must be accessed through proxy. Usually this is SOCLS5
proxy, but at the type level there is no information about the specific
proxy type which should be used (however they may contained within the
generic type parameter
A
).
Enums§
- Addr
Parse Error - Error parsing network address.
- Host
Name - A host name covers multiple types which are not necessarily resolved by an
OS and may require additional name resolvers (like via SOCKS5 etc). The type
doesn’t provide an information about the resolver; for that use
super::ProxiedHost
. - Inet
Host dns
- An Internet host name which can be resolved by standard OS means (and thus
accepted by
std::net
methods via use ofstd::net::ToSocketAddrs
trait, when combined with a port address). - Peer
Addr Parse Error p2p-ed25519
orp2p-secp256k1
- Proxied
Host - An host which should be accessed via a proxy - or accessed directly.
Traits§
- Addr
- Marker trait for all network addresses which can be connected to.
- Host
- Marker trait for all types of host names.
- Localhost
- Trait for address types which can represent a localhost address.
- ToSocket
Addr - Trait for the types which are able to return socket address to connect to. NBL In case of a proxied addresses this should be an address of the proxy, not the destination host.