cmtls

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ID = "/cmtls/1.0.0"

ID is the protocol ID (used when negotiating with multistream)

Variables

This section is empty.

Functions

func New

func New(
	tlsCfg *tls.Config,
	host func() host.Host,
	logger api.Logger,
) func(key crypto.PrivKey) (*Transport, error)

New . @Description: return a function can create a new Transport instance. @param tlsCfg: @param host: @param logger: @param : @return func(key crypto.PrivKey) (*Transport, error):

Types

type Transport

type Transport struct {
	LibP2pHost func() host.Host
	// contains filtered or unexported fields
}

Transport constructs secure communication sessions for a peer.

func (*Transport) SecureInbound

func (t *Transport) SecureInbound(ctx context.Context, insecure net.Conn) (sec.SecureConn, error)

SecureInbound . @Description: runs the TLS handshake as a server. @receiver t @param ctx: @param insecure: @return sec.SecureConn: @return error:

func (*Transport) SecureOutbound

func (t *Transport) SecureOutbound(ctx context.Context, insecure net.Conn, p peer.ID) (sec.SecureConn, error)

SecureOutbound . @Description: runs the TLS handshake as a client. @receiver t @param ctx: @param insecure: @param p: @return sec.SecureConn: @return error:

Jump to

Keyboard shortcuts

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