webrtc

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package webrtc contains the webmesh WebRTC service.

Package webrtc contains the webmesh WebRTC service.

Index

Constants

This section is empty.

Variables

View Source
var DefaultSTUNServers = []string{
	"stun:stun.l.google.com:19302",
}

DefaultSTUNServers are the default STUN servers to use.

Functions

This section is empty.

Types

type DHTOptions added in v0.4.0

type DHTOptions struct {
	// RendevousStrings is a map of peer IDs to rendezvous strings
	// for allowing signaling through libp2p.
	RendezvousStrings map[string]string
	// BootstrapServers is a list of bootstrap servers to use for the DHT.
	// If empty or nil, the default bootstrap servers will be used.
	BootstrapServers []multiaddr.Multiaddr
	// LocalAddrs is a list of local addresses to announce to the discovery service.
	// If empty, the default local addresses will be used.
	LocalAddrs []multiaddr.Multiaddr
	// AnnounceTTL is the TTL for each announcement.
	AnnounceTTL time.Duration
	// STUNServers is a list of STUN servers to use for NAT traversal.
	// If empty, the default STUN servers will be used.
	STUNServers []string
	// WireGuardPort is the port to use for connections targeting WireGuard.
	WireGuardPort int
	// ConnectTimeout is the timeout for connecting to a peer.
	ConnectTimeout time.Duration
}

DHTOptions are options for the DHTServer.

type DHTServer added in v0.4.0

type DHTServer struct {
	DHTOptions
	// contains filtered or unexported fields
}

DHTServer is the webmesh DHT service.

func NewDHTServer added in v0.4.0

func NewDHTServer(opts DHTOptions) *DHTServer

NewDHTServer returns a new DHTServer.

func (*DHTServer) ListenAndServe added in v0.4.0

func (srv *DHTServer) ListenAndServe() error

ListenAndServe starts the server and blocks until the server exits.

func (*DHTServer) Shutdown added in v0.4.0

func (srv *DHTServer) Shutdown(ctx context.Context) error

Shutdown attempts to stops the server gracefully.

type Options added in v0.3.0

type Options struct {
	ID          string
	Storage     storage.MeshStorage
	Wireguard   wireguard.Interface
	NodeDialer  transport.NodeDialer
	RBAC        rbac.Evaluator
	STUNServers []string
}

Options are options for the WebRTC service.

type Server

type Server struct {
	v1.UnimplementedWebRTCServer
	// contains filtered or unexported fields
}

Server is the webmesh WebRTC service.

func NewServer

func NewServer(opts Options) *Server

NewServer returns a new Server.

func (*Server) StartDataChannel

func (s *Server) StartDataChannel(stream v1.WebRTC_StartDataChannelServer) error

Jump to

Keyboard shortcuts

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