csms

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT, MIT Imports: 6 Imported by: 0

README

go-conn-security-multistream

Discourse posts GoDoc

Connection security multistream multiplexer

This package provides a multistream multiplexed security transport. It:

  1. Selects a security transport using multistream-select.
  2. Secures the stream using the selected transport.

Known libp2p security transports include:

Install

go-conn-security-multistream is a standard Go module which can be installed with:

go get github.com/libp2p/go-conn-security-multistream

This repo is gomod-compatible, and users of go 1.11 and later with modules enabled will automatically pull the latest tagged release by referencing this package. Upgrades to future releases can be managed using go get, or by editing your go.mod file as described by the gomod documentation.

Usage

For more information about how go-conn-security-multistream is used in the libp2p context, you can see the go-libp2p-conn module.

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the libp2p Code of Conduct.

Want to hack on libp2p?

License

MIT


The last gx published version of this module was: 0.1.26: QmZWmFkMm28sWeDr5Xh1LexdKBGYGp946MNCfgtLqfX73z

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSMuxer

type SSMuxer struct {
	OrderPreference []string
	// contains filtered or unexported fields
}

SSMuxer is a multistream stream security transport multiplexer.

SSMuxer is safe to use without initialization. However, it's not safe to move after use.

func (*SSMuxer) AddTransport

func (sm *SSMuxer) AddTransport(path string, transport sec.SecureTransport)

AddTransport adds a stream security transport to this multistream muxer.

This method is *not* thread-safe. It should be called only when initializing the SSMuxer.

func (*SSMuxer) SecureInbound

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

SecureInbound secures an inbound connection using this multistream multiplexed stream security transport.

func (*SSMuxer) SecureOutbound

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

SecureOutbound secures an outbound connection using this multistream multiplexed stream security transport.

Jump to

Keyboard shortcuts

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