Documentation ¶
Overview ¶
Package naconn provides node-oriented connection based on ETLS crypto connection.
This package requires a node ID resolver to work like a traditional DNS resolver, except that it resolves node IDs into IP addresses (and ports).
Index ¶
- Constants
- func Dial(remote proto.NodeID) (conn net.Conn, err error)
- func DialEx(remote proto.NodeID, isAnonymous bool) (conn net.Conn, err error)
- func GetSharedSecretWith(resolver Resolver, nodeID *proto.RawNodeID, isAnonymous bool) (symmetricKey []byte, err error)
- func RegisterResolver(resolver Resolver)
- type NAConn
- type Remoter
- type Resolver
Constants ¶
View Source
const ( // HeaderSize is the header size with ETLSHeader + NodeID + Nonce. HeaderSize = etls.MagicSize + hash.HashBSize + cpuminer.Uint256Size )
Variables ¶
This section is empty.
Functions ¶
func GetSharedSecretWith ¶
func GetSharedSecretWith(resolver Resolver, nodeID *proto.RawNodeID, isAnonymous bool) (symmetricKey []byte, err error)
GetSharedSecretWith gets shared symmetric key with ECDH.
func RegisterResolver ¶
func RegisterResolver(resolver Resolver)
RegisterResolver registers the default resolver.
Types ¶
type NAConn ¶
type NAConn struct { *etls.CryptoConn // contains filtered or unexported fields }
NAConn defines node aware connection based on ETLS crypto connection.
func NewServerConn ¶
NewServerConn takes a raw connection and returns a new server side NAConn.
Click to show internal directories.
Click to hide internal directories.