Documentation ¶
Overview ¶
Package libp2pwebrtc implements the WebRTC transport for go-libp2p, as described in https://github.com/libp2p/specs/tree/master/webrtc.
Index ¶
- Constants
- func IsWebRTCDirectMultiaddr(addr ma.Multiaddr) (bool, int)
- type ListenUDPFn
- type Option
- type WebRTCTransport
- func (t *WebRTCTransport) AddCertHashes(addr ma.Multiaddr) (ma.Multiaddr, bool)
- func (t *WebRTCTransport) CanDial(addr ma.Multiaddr) bool
- func (t *WebRTCTransport) Dial(ctx context.Context, remoteMultiaddr ma.Multiaddr, p peer.ID) (tpt.CapableConn, error)
- func (t *WebRTCTransport) Listen(addr ma.Multiaddr) (tpt.Listener, error)
- func (t *WebRTCTransport) ListenOrder() int
- func (t *WebRTCTransport) Protocols() []int
- func (t *WebRTCTransport) Proxy() bool
Constants ¶
View Source
const ( DefaultDisconnectedTimeout = 20 * time.Second DefaultFailedTimeout = 30 * time.Second DefaultKeepaliveTimeout = 15 * time.Second )
timeout values for the peerconnection https://github.com/pion/webrtc/blob/v3.1.50/settingengine.go#L102-L109
View Source
const ( // This is higher than other transports(64) as there's no way to detect a peer that has gone away after // sending the initial connection request message(STUN Binding request). Such peers take up a goroutine // till connection timeout. As the number of handshakes in parallel is still guarded by the resource // manager, this higher number is okay. DefaultMaxInFlightConnections = 128 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ListenUDPFn ¶ added in v0.36.0
type Option ¶
type Option func(*WebRTCTransport) error
type WebRTCTransport ¶
type WebRTCTransport struct {
// contains filtered or unexported fields
}
func New ¶
func New(privKey ic.PrivKey, psk pnet.PSK, gater connmgr.ConnectionGater, rcmgr network.ResourceManager, listenUDP ListenUDPFn, opts ...Option) (*WebRTCTransport, error)
func (*WebRTCTransport) AddCertHashes ¶ added in v0.34.0
func (*WebRTCTransport) Dial ¶
func (t *WebRTCTransport) Dial(ctx context.Context, remoteMultiaddr ma.Multiaddr, p peer.ID) (tpt.CapableConn, error)
func (*WebRTCTransport) Listen ¶
Listen returns a listener for addr.
The IP, Port combination for addr must be exclusive to this listener as a WebRTC listener cannot be multiplexed on the same port as other UDP based transports like QUIC and WebTransport. See https://github.com/libp2p/go-libp2p/issues/2446 for details.
func (*WebRTCTransport) ListenOrder ¶ added in v0.36.0
func (t *WebRTCTransport) ListenOrder() int
func (*WebRTCTransport) Protocols ¶
func (t *WebRTCTransport) Protocols() []int
func (*WebRTCTransport) Proxy ¶
func (t *WebRTCTransport) Proxy() bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.