38 Commits

Author SHA1 Message Date
philipch07
14b3cccabf Replace verbose check with slices.Contains 2025-09-14 14:58:35 -04:00
Joe Turki
cad1676659 Upgrade golangci-lint, more linters
Introduces new linters, upgrade golangci-lint to version (v1.63.4)
2025-01-17 08:21:15 -06:00
Amin Cheloh
35bb3fb992 docs(agent_config.go): update KeepaliveInterval default value to 2 sec
Update documentation for KeepaliveInterval to match defaultKeepaliveInterval constant
2024-11-26 10:53:54 -05:00
WofWca
8b8fffdc3c Use named return val for IP/if filter
This should make it clear that you need to return `true`
to keep it and `false` to exclude.

Relates to pion/webrtc#2958
2024-11-26 10:48:44 -05:00
Raja Subramanian
9407bb0d2a Accept use-candidate unconditionally for ice-lite (#739)
There could be a mismatch between the two ends in candidate priority
when using peer reflexive. It happens in the following scenario

1. Client has two srflx candidates.
   a. The first one gets discovered by LiveKit server as prflx.
   b. The second one gets added via ice-trickle first and then
      gets a STUN ping. So, it is srflx remote candidate from
      server's point-of-view.
2. This leads to a priority issue.
   a. Both candidates have same priority from client's point-of-view
      (both are srflx).
   b. But, from server's point-of-view, the first candidate has
      higher priority (prflx).
3. The first candidate establishes connectivity and becomes
   the selected pair (client is ICE controlling and server is
   ICE controlled, server is in ICE lite).
4. libwebrtc does a sort and switch some time later based on RTT.
   As client side has both at same priority, RTT based sorting
   could make the second candidate the preferred one.
   So, the client sends useCandidate=1 for the second candidate.
   pion/ice does not switch because the selected pair is at
   higher priority due to prflx candidate.
5. STUN pings do not happen and the ICE connection eventually fails.

ICE controlled agent should accept use-candidate unconditionally if
it is an ICE lite agentt.
Just in case existing behaviour is needed, it can be configured
using `EnableUseCandidateCheckPriority`.

NOTE: With aggressive nomination, the selected pair could change
a few times, but should eventually settle on what the controlling
side wants.
2024-10-31 11:05:14 +05:30
Pion
bf68674e63 Update CI configs to v0.11.15
Update lint scripts and CI configs.
2024-08-16 12:26:32 -04:00
Sean DuBois
39c90d8419 Upgrade dtls, turn and sturn
New major version of dtls causes API breaks on three packages
2024-08-12 11:43:44 -04:00
Sean DuBois
07b74c8a97 Add BindingRequestHandler
Allow the user to perform custom processing for inbound STUN Binding
requests. This allows users to do some of the following

* Log incoming Binding Requests for debugging
* Implement draft-thatcher-ice-renomination
* Implement custom CandidatePair switching logic

Resolves pion/webrtc#2539
Resolves pion/webrtc#2585
Resolves #623
2024-05-01 23:28:44 -04:00
Federico Guerinoni
e6b8683f5d Fix doc comments about AgentConfig 2024-04-16 20:58:48 -04:00
Sean DuBois
c1e4dd11e9 Stun -> STUN for Config Entry 2024-04-03 09:49:49 -04:00
Stephan Rotolante
edaa25e409 Expose stunGatherTimeout in Agent struct (#668) 2024-04-02 23:17:51 -04:00
renovate[bot]
8d69e9ecd8 Update module github.com/pion/stun to v2
Generated by renovateBot
2023-09-08 14:25:52 -04:00
renovate[bot]
d21edf9690 Start pion/ice@v3
This is required to update pion/transport/v2 to v3

The public API of transport changed, and we expose transport as part of
our public API.
2023-09-03 23:51:36 -04:00
Sean DuBois
db5d7ea72b Implement Active ICE TCP Candidates
Co-authored-by: Steffen Vogel <post@steffenvogel.de>
Co-authored-by: Artur Shellunts <shellunts.artur@gmail.com>
2023-06-15 21:44:21 -04:00
Sean DuBois
abc1ca33b5 Revert active TCP candidate support
This reverts commit 00bbd2954c
and 1d502ca6ec
2023-05-24 00:05:44 -04:00
Artur Shellunts
1d502ca6ec Implement active TCP candidate type (RFC6544)
By default TCP candidate type priority is UDP one minus 27 (except
relay), so that UDP+srlfx priority > TCP+host priority. That priority
offset can be configured using AgentConfig.
IPv6 TCP candidates are also supported.
2023-05-15 22:41:52 +02:00
Steffen Vogel
ca9de18fd6 Move URL type to pion/stun.URI 2023-05-10 16:33:20 +02:00
Steffen Vogel
f40dd65abb Fix comment capitalization
Comments should start with an uppercase letter.
2023-04-18 19:38:54 +02:00
Steffen Vogel
5ef81b65f4 Make package REUSE compliant 2023-04-18 13:46:38 +02:00
Steffen Vogel
0194bd6ce8 Use new pion/transport Net interface
This change adapts pion/ice to use a new interface for most network
related operations. The interface was formerly a simple struct vnet.Net
which was originally intended to facilicate testing. By replacing it
with an interface we have greater flexibility and allow users to hook
into the networking stack by providing their own implementation of
the interface.
2023-02-08 21:58:49 +01:00
cnderrauber
e90a58e51a Add option to include loopback candidate
Add option to include loopback candidate
2022-11-22 17:07:31 +08:00
Steffen Vogel
90a16ec70b Fix several typos throughout the codebase
As detected by an automatic spell checker.
2022-11-13 21:56:24 +01:00
cnderrauber
cd0a968a62 Add IPFilter to AgentConfig
When machine's network interface have more than one ip address and
user don't want expose one of these ips to remote peer, interface
filter can't work in this case, so add a ip filter for that.
2022-09-29 14:06:21 +08:00
cnderrauber
18f7a214aa Accept aggressive nomination
Add config for accept aggressive nomination, it is useful for
compatible with chrome or other clients use aggressive nominate
to update nominate candidate pairs.
2022-04-21 15:18:01 +08:00
Mikhail Bragin
2d70ec8e3c Support UDP muxing for SRFLX candidates
The original UDPMux only works for the HOST candidates.
UniversalUDPMux adds support for SRFLX candidates
and will later support Relay candidates.
UniversalUDPMux embeds UDPMuxDefault and
handles STUN server packets to discover XORMappedAddr
forwarding the remaining packets for muxing to UDPMuxDefault.
2022-02-20 12:29:29 -08:00
Kyle Carberry
c7f5f6e56c Expose CheckInterval on AgentConfig
Allow users to configure how often internal task loop runs
2021-05-16 12:03:06 -07:00
David Zhao
86d69d6ce5 Single port handling via UDPMux
Allows for ICE to handle connections on a single UDP port
2021-04-12 20:42:10 -07:00
Assad Obaid
64a2cf0c47 Add proxy dialer interface
Enable user to implement the golang.org/x/net/proxy
dialer interface in order to have a customized dialer.
The customized dialer could be one that connect through
a corporate HTTP/HTTPS proxy.

Resolves #284
2020-10-09 12:09:21 -07:00
Pion
d3e1775d73 Update CI configs to v0.4.7
Update lint scripts and CI configs.
2020-09-26 08:54:24 -07:00
Jerko Steiner
3b9a989177 Remove global state for ICE TCP
This addresses a few points issue of #245:

 - Take a net.Listener instead of having global state
 - Expose a net.TCPMux based API

Also, the unused closeChannel was removed from tcp_mux.go

Closes #253.
2020-08-01 09:28:28 +02:00
Yutaka Takeda
5d2bbc818c Increase binding req timeout value
Resolves #255
2020-07-26 12:08:17 -07:00
Jerko Steiner
12f44e93f1 Add support for passive ICE TCP candidate
Closes #196
2020-07-15 07:51:55 +02:00
Sean DuBois
ac027bafb5 Remove CandidateSelectionTimeout
The code that uses this field was removed in
e264665676 but the field
wasn't properly removed from the public API.
2020-07-06 00:13:44 -07:00
Sam Lancia
a4a53ab443 Agent: Frequent candidate check when connecting
Previously in the connecting phase, a gathered peer reflexive candidate
which is by default nominated after 500mS, would have to wait 2s
(default taskLoopInterval) before being nominated.
2020-07-05 17:45:01 +09:00
Sean DuBois
3b47033146 Remove non-trickle ICE
pion/webrtc@v3 will be trickle by default, so removing
support from here.  Users can easily simulate non-trickle
by setting a OnICECandidate callback.

This just reduces the amount of things we need to test/worry about.
2020-06-25 00:16:58 -07:00
Sean DuBois
5a7603837b Set defaultKeepaliveInterval to 2 seconds
This should be lower then defaultDisconnectTimeout otherwise
we are going to enter disconnected.

Also rename defaultDisconnectTimeout -> defaultDisconnectedTimeout
to make the tense consistent with other options

Resolves #190
2020-06-25 00:16:58 -07:00
Sean DuBois
330f9098dd Move initExtIPMapping to agent_config
Put all config logic in a dedicated file
2020-06-25 00:16:58 -07:00
Sean DuBois
2536409ce1 Move AgentConfig to dedicated file
Trying to reduce some complexity from the Agent
2020-06-21 01:06:53 -07:00