package pnet

Import Path
	github.com/libp2p/go-libp2p/core/pnet (on go.dev)

Dependency Relation
	imports 7 packages, and imported by 7 packages

Involved Source Files codec.go env.go error.go Package pnet provides interfaces for private networking in libp2p.
Package-Level Type Names (total 2)
/* sort by: | */
Error is error type for ease of detecting PNet errors ( Error) IsPNetError() bool
A PSK enables private network implementation to be transparent in libp2p. It is used to ensure that peers can only establish connections to other peers that are using the same PSK. func DecodeV1PSK(in io.Reader) (PSK, error) func github.com/libp2p/go-libp2p.PrivateNetwork(psk PSK) libp2p.Option func github.com/libp2p/go-libp2p/p2p/net/pnet.NewProtectedConn(psk PSK, conn net.Conn) (net.Conn, error) func github.com/libp2p/go-libp2p/p2p/net/upgrader.New(security []sec.SecureTransport, muxers []upgrader.StreamMuxer, psk PSK, rcmgr network.ResourceManager, connGater connmgr.ConnectionGater, opts ...upgrader.Option) (transport.Upgrader, error) func github.com/libp2p/go-libp2p/p2p/transport/quic.NewTransport(key ic.PrivKey, connManager *quicreuse.ConnManager, psk PSK, gater connmgr.ConnectionGater, rcmgr network.ResourceManager) (tpt.Transport, error) func github.com/libp2p/go-libp2p/p2p/transport/webrtc.New(privKey ic.PrivKey, psk PSK, gater connmgr.ConnectionGater, rcmgr network.ResourceManager, listenUDP libp2pwebrtc.ListenUDPFn, opts ...libp2pwebrtc.Option) (*libp2pwebrtc.WebRTCTransport, error) func github.com/libp2p/go-libp2p/p2p/transport/webtransport.New(key ic.PrivKey, psk PSK, connManager *quicreuse.ConnManager, gater connmgr.ConnectionGater, rcmgr network.ResourceManager, opts ...libp2pwebtransport.Option) (tpt.Transport, error)
Package-Level Functions (total 3)
DecodeV1PSK reads a Multicodec encoded V1 PSK.
IsPNetError checks if given error is PNet Error
NewError creates new Error
Package-Level Variables (total 2)
ErrNotInPrivateNetwork is an error that should be returned by libp2p when it tries to dial with ForcePrivateNetwork set and no PNet Protector
ForcePrivateNetwork is boolean variable that forces usage of PNet in libp2p Setting this variable to true or setting LIBP2P_FORCE_PNET environment variable to true will make libp2p to require private network protector. If no network protector is provided and this variable is set to true libp2p will refuse to connect.
Package-Level Constants (only one)
EnvKey defines environment variable name for forcing usage of PNet in libp2p When environment variable of this name is set to "1" the ForcePrivateNetwork variable will be set to true.