csms

package
v0.0.0-...-8b9b725 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2019 License: MIT, MIT Imports: 6 Imported by: 8

README

go-conn-security-multistream

standard-readme compliant GoDoc Coverage Status Build Status

Connection security multistream multiplexer

This package provides a multistream multiplexed security transport. It:

  1. Selects a security 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

Note that go-conn-security-multistream is packaged with Gx, so it is recommended to use Gx to install and use it (see the Usage section).

Usage

This module is packaged with Gx. In order to use it in your own project it is recommended that you:

go get -u github.com/whyrusleeping/gx
go get -u github.com/whyrusleeping/gx-go
cd <your-project-repository>
gx init
gx import github.com/libp2p/go-conn-security-multistream
gx install --global
gx-go --rewrite

Please check Gx and Gx-go documentation for more information.

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 IPFS Code of Conduct.

Want to hack on IPFS?

License

MIT

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 connsec.Transport)

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) (connsec.Conn, 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) (connsec.Conn, 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