Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EncryptConnections = true
EncryptConnections is a global parameter because it should either be enabled or _completely disabled_. I.e. a node should only be able to talk to proper (encrypted) networks if it is encrypting all its transports. Running a node with disabled transport encryption is useful to debug the protocols, achieve implementation interop, or for private networks which -- for whatever reason -- _must_ run unencrypted.
Functions ¶
Types ¶
type Conn ¶
type Conn interface { smux.Conn // ID is an identifier unique to this connection. ID() string LocalAddr() net.Addr RemoteAddr() net.Addr Transport() tpt.Transport // LocalPeer (this side) ID, PrivateKey, and Address LocalPeer() peer.ID LocalPrivateKey() ic.PrivKey LocalMultiaddr() ma.Multiaddr // RemotePeer ID, PublicKey, and Address RemotePeer() peer.ID RemotePublicKey() ic.PubKey RemoteMultiaddr() ma.Multiaddr }
Conn is a generic multi-stream message-based Peer-to-Peer connection. It contains the PeerConn interface (unfortunately Go still doesn't allow duplicate interface methods...)
type Listener ¶
type Listener interface { // Accept waits for and returns the next connection to the listener. Accept() (Conn, error) // Addr is the local address Addr() net.Addr // Multiaddr is the local multiaddr address Multiaddr() ma.Multiaddr // LocalPeer is the identity of the local Peer. LocalPeer() peer.ID SetAddrFilters(*filter.Filters) // Close closes the listener. // Any blocked Accept operations will be unblocked and return errors. Close() error }
Listener is an object that can accept connections. It matches net.Listener
Click to show internal directories.
Click to hide internal directories.