ice

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultSTUNServers

func DefaultSTUNServers() []string

Types

type Credential

type Credential struct {
	Ufrag string `json:"ufrag"`
	Pwd   string `json:"pwd"`
}

type IceOp

type IceOp func(context.Context, string, string) (*ice.Conn, error)

type Message

type Message struct {
	StudyID   string      `json:"studyID"`
	Type      MessageType `json:"type"`
	Data      string      `json:"data"`
	SourcePID mpc.PID     `json:"sourcePID"`
	TargetPID mpc.PID     `json:"targetPID"`
}

type MessageType

type MessageType string
const (
	MessageTypeCandidate  MessageType = "candidate"
	MessageTypeCredential MessageType = "credential"
	MessageTypeError      MessageType = "error"
)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(
	ctx context.Context,
	api *url.URL,
	rawStunURIs []string,
	studyID string,
	mpcConf *mpc.Config,
) (s *Service, err error)

func (*Service) GetConn added in v0.0.2

func (s *Service) GetConn(
	ctx context.Context,
	peerPID mpc.PID,
) (_ <-chan *conn.PacketConn, err error)

GetPacketConn establishes an ICE-managed connection with a peer, and returns a *conn.PacketConn channel, which allows the client to subscribe to changes in the connection.

Based on https://github.com/pion/ice/tree/master/examples/ping-pong

func (*Service) Stop

func (s *Service) Stop() (err error)

Jump to

Keyboard shortcuts

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