Categorygithub.com/pion/ice/v4
modulepackage
4.0.7
Repository: https://github.com/pion/ice.git
Documentation: pkg.go.dev

# README


Pion ICE

A Go implementation of ICE

Pion ICE Slack Widget
GitHub Workflow Status Go Reference Coverage Status Go Report Card License: MIT


Roadmap

The library is used as a part of our WebRTC implementation. Please refer to that roadmap to track our major milestones.

Community

Pion has an active community on the Slack.

Follow the Pion Twitter for project updates and important WebRTC news.

We are always looking to support your projects. Please reach out if you have something to build! If you need commercial support or don't want to use public methods you can contact us at [email protected]

Contributing

Check out the contributing wiki to join the group of amazing people making this project possible

License

MIT License - see LICENSE for full text

# Packages

No description provided by the author

# Functions

NewAgent creates a new Agent.
NewCandidateHost creates a new host candidate.
NewCandidatePeerReflexive creates a new peer reflective candidate.
NewCandidateRelay creates a new relay candidate.
NewCandidateServerReflexive creates a new server reflective candidate.
NewMultiTCPMuxDefault creates an instance of MultiTCPMuxDefault that uses the provided TCPMux instances.
NewMultiUDPMuxDefault creates an instance of MultiUDPMuxDefault that uses the provided UDPMux instances.
NewMultiUDPMuxFromPort creates an instance of MultiUDPMuxDefault that listen all interfaces on the provided port.
NewTCPMuxDefault creates a new instance of TCPMuxDefault.
NewTCPType creates a new TCPType from string.
NewUDPMuxDefault creates an implementation of UDPMux.
NewUniversalUDPMuxDefault creates an implementation of UniversalUDPMux embedding UDPMux.
UDPMuxFromPortWithInterfaceFilter set the filter to filter out interfaces that should not be used.
UDPMuxFromPortWithIPFilter set the filter to filter out IP addresses that should not be used.
UDPMuxFromPortWithLogger set the logger for the created UDPMux.
UDPMuxFromPortWithLoopback set loopback interface should be included.
UDPMuxFromPortWithNet sets the network transport to use.
UDPMuxFromPortWithNetworks set the networks that should be used.
UDPMuxFromPortWithReadBufferSize set the UDP connection read buffer size.
UDPMuxFromPortWithWriteBufferSize set the UDP connection write buffer size.
UnmarshalCandidate Parses a candidate from a string https://datatracker.ietf.org/doc/html/rfc5245#section-15.1.
UseCandidate is shorthand for UseCandidateAttr.

# Constants

CandidatePairStateFailed means a check for this pair was already done and failed, either never producing any response or producing an unrecoverable failure response.
CandidatePairStateInProgress means a check has been sent for this pair, but the transaction is in progress.
CandidatePairStateSucceeded means a check for this pair was already done and produced a successful result.
CandidatePairStateWaiting means a check has not been performed for this pair.
CandidateType enum.
CandidateType enum.
CandidateType enum.
CandidateType enum.
CandidateType enum.
ComponentRTCP indicates that the candidate is used for RTCP.
ComponentRTP indicates that the candidate is used for RTP.
ConnectionStateChecking ICE agent has been given local and remote candidates, and is attempting to find a match.
ConnectionStateClosed ICE agent has finished and is no longer handling requests.
ConnectionStateCompleted ICE agent has finished.
ConnectionStateConnected ICE agent has a pairing, but is still checking other pairs.
ConnectionStateDisconnected ICE agent connected successfully, but has entered a failed state.
ConnectionStateFailed ICE agent never could successfully connect.
ConnectionStateNew ICE agent is gathering addresses.
ConnectionStateUnknown represents an unknown state.
Possible ICE agent roles.
Possible ICE agent roles.
GatheringStateComplete indicates candidate gathering has been completed.
GatheringStateGathering indicates candidate gathering is ongoing.
GatheringStateNew indicates candidate gathering is not yet started.
GatheringStateUnknown represents an unknown state.
MulticastDNSModeDisabled means remote mDNS candidates will be discarded, and local host candidates will use IPs.
MulticastDNSModeQueryAndGather means remote mDNS candidates will be accepted, and local host candidates will use mDNS.
MulticastDNSModeQueryOnly means remote mDNS candidates will be accepted, and local host candidates will use IPs.
NetworkTypeTCP4 indicates TCP over IPv4.
NetworkTypeTCP6 indicates TCP over IPv6.
NetworkTypeUDP4 indicates UDP over IPv4.
NetworkTypeUDP6 indicates UDP over IPv6.
ProtoTypeTCP indicates the URL uses a TCP transport.
ProtoTypeUDP indicates the URL uses a UDP transport.
SchemeTypeSTUN indicates the URL represents a STUN server.
SchemeTypeSTUNS indicates the URL represents a STUNS (secure) server.
SchemeTypeTURN indicates the URL represents a TURN server.
SchemeTypeTURNS indicates the URL represents a TURNS (secure) server.
TCPTypeActive is active TCP candidate, which initiates TCP connections.
TCPTypePassive is passive TCP candidate, only accepts TCP connections.
TCPTypeSimultaneousOpen is like active and passive at the same time.
TCPTypeUnspecified is the default value.
Unknown represents and unknown ProtoType or SchemeType.

# Variables

ErrAddressParseFailed indicates we were unable to parse a candidate address.
ErrCanceledByCaller indicates agent connection was canceled by the caller.
ErrClosed indicates the agent is closed.
ErrDetermineNetworkType indicates that the NetworkType was not able to be parsed.
ErrExternalMappedIPNotFound in NAT1To1IPMapping.
ErrGetTransportAddress can't convert net.Addr to underlying type (UDPAddr or TCPAddr).
ErrHost indicates malformed hostname is provided.
ErrIneffectiveNAT1To1IPMappingHost indicates that 1:1 NAT IP mapping for host candidate is requested, but the host candidate type is disabled.
ErrIneffectiveNAT1To1IPMappingSrflx indicates that 1:1 NAT IP mapping for srflx candidate is requested, but the srflx candidate type is disabled.
ErrInvalidMulticastDNSHostName indicates an invalid MulticastDNSHostName.
ErrInvalidNAT1To1IPMapping indicates that the given 1:1 NAT IP mapping is invalid.
ErrInvalidQuery indicates an malformed query is provided.
ErrLiteUsingNonHostCandidates indicates non host candidates were selected for a lite agent.
ErrLocalPwdInsufficientBits indicates local password insufficient bits are provided.
ErrLocalUfragInsufficientBits indicates local username fragment insufficient bits are provided.
ErrMulticastDNSWithNAT1To1IPMapping indicates that the mDNS gathering cannot be used along with 1:1 NAT IP mapping for host candidate.
ErrMultipleGatherAttempted indicates GatherCandidates has been called multiple times.
ErrMultipleStart indicates agent was started twice.
ErrNoCandidatePairs indicates agent does not have a valid candidate pair.
ErrNoOnCandidateHandler indicates agent was started without OnCandidate.
ErrPasswordEmpty indicates agent was give TURN URL with an empty Password.
ErrPort indicates malformed port is provided.
ErrProtoType indicates an unsupported transport type was provided.
ErrRemotePwdEmpty indicates agent was started with an empty remote pwd.
ErrRemoteUfragEmpty indicates agent was started with an empty remote ufrag.
ErrRunCanceled indicates a run operation was canceled by its individual done.
ErrSchemeType indicates the scheme type could not be parsed.
ErrSTUNQuery indicates query arguments are provided in a STUN URL.
ErrTCPRemoteAddrAlreadyExists indicates we already have the connection with same remote addr.
ErrUnknownCandidateTyp indicates that a candidate had a unknown type value.
ErrUnknownType indicates an error with Unknown info.
ErrUnsupportedNAT1To1IPCandidateType indicates that the specified NAT1To1IPCandidateType is unsupported.
ErrUselessUrlsProvided indicates that one or more URL was provided to the agent but no host candidate required them.
ErrUsernameEmpty indicates agent was give TURN URL with an empty Username.
nolint:gochecknoglobals.
nolint:gochecknoglobals.
nolint:gochecknoglobals.

# Structs

Agent represents the ICE agent.
AgentConfig collects the arguments to ice.Agent construction into a single structure, for future-proofness of the interface.
AttrControl is helper that wraps ICE-{CONTROLLED,CONTROLLING}.
CandidateExtension represents a single candidate extension as defined in https://tools.ietf.org/html/rfc5245#section-15.1 .
CandidateHost is a candidate of type host.
CandidateHostConfig is the config required to create a new CandidateHost.
CandidatePair is a combination of a local and remote candidate.
CandidatePairStats contains ICE candidate pair statistics.
CandidatePeerReflexive ...
CandidatePeerReflexiveConfig is the config required to create a new CandidatePeerReflexive.
CandidateRelatedAddress convey transport addresses related to the candidate, useful for diagnostics and other purposes.
CandidateRelay ...
CandidateRelayConfig is the config required to create a new CandidateRelay.
CandidateServerReflexive ...
CandidateServerReflexiveConfig is the config required to create a new CandidateServerReflexive.
CandidateStats contains ICE candidate statistics related to the ICETransport objects.
Conn represents the ICE connection.
MultiTCPMuxDefault implements both TCPMux and AllConnsGetter, allowing users to pass multiple TCPMux instances to the ICE agent configuration.
MultiUDPMuxDefault implements both UDPMux and AllConnsGetter, allowing users to pass multiple UDPMux instances to the ICE agent configuration.
TCPMuxDefault muxes TCP net.Conns into net.PacketConns and groups them by Ufrag.
TCPMuxParams are parameters for TCPMux.
UDPMuxDefault is an implementation of the interface.
UDPMuxParams are parameters for UDPMux.
UniversalUDPMuxDefault handles STUN and TURN servers packets by wrapping the original UDPConn overriding ReadFrom.
UniversalUDPMuxParams are parameters for UniversalUDPMux server reflexive.
UseCandidateAttr represents USE-CANDIDATE attribute.

# Interfaces

AllConnsGetter allows multiple fixed TCP ports to be used, each of which is multiplexed like TCPMux.
Candidate represents an ICE candidate.
TCPMux is allows grouping multiple TCP net.Conns and using them like UDP net.PacketConns.
UDPMux allows multiple connections to go over a single UDP port.
UDPMuxFromPortOption provide options for NewMultiUDPMuxFromPort.
UniversalUDPMux allows multiple connections to go over a single UDP port for host, server reflexive and relayed candidates.

# Type aliases

AddrPort is an IP and a port number.
AttrControlled represents ICE-CONTROLLED attribute.
AttrControlling represents ICE-CONTROLLING attribute.
CandidatePairState represent the ICE candidate pair state.
CandidateType represents the type of candidate.
ConnectionState is an enum showing the state of a ICE Connection.
GatheringState describes the state of the candidate gathering process.
MulticastDNSMode represents the different Multicast modes ICE can run in.
NetworkType represents the type of network.
PriorityAttr represents PRIORITY attribute.
No description provided by the author
Role represents ICE agent role, which can be controlling or controlled.
No description provided by the author
TCPType is the type of ICE TCP candidate as described in https://tools.ietf.org/html/rfc6544#section-4.5.
No description provided by the author