19 Commits

Author SHA1 Message Date
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
Eric Daniels
39c0392295 Support IPv6 from mDNS 2024-03-27 12:47:20 -04:00
José Mélançon
8680cd591f Match libwebrtc's TURN protocol priority
Today, all relay candidates from Pion have the same priority.
This PR attempts to reproduce libwebrtc's behavior, where the
TURN servers candidates priority is based on the underlying
relay protocol. UDP are preferred over TCP, which are preferred
over the TLS options.
2024-03-20 14:42:20 -04:00
San9H0
f07b6d16ad Add RemoteCandidateCache for better performance
Check sourceAddress from first packet validation of STUNTraffic.
If validation is true, store it in the cache.
Use cache for performance.
2023-04-18 19:20:52 +02:00
Steffen Vogel
5ef81b65f4 Make package REUSE compliant 2023-04-18 13:46:38 +02:00
Steffen Vogel
bce6de3c84 Implement copy() for CandidateRelay
Relay candidates have an additional field "relayProtocol"
which is not marshaled and hence not copied by the
candidateBase's copy() method.

This change is required to properly expose the relay
protocol for via the agents GetSelectedCandidatePair()
function as it internally copies the candidates.
2022-11-14 16:01:28 +02:00
Meelap Shah
1b533aee68 Populate RelayProtocol for relay candidates
The webrtc-stats spec defines this field as:
> It is the protocol used by the endpoint to communicate with the TURN
> server. This is only present for local candidates. Valid values are
> "udp", "tcp", or "tls".
https://w3.org/TR/webrtc-stats/#dom-rtcicecandidatestats-relayprotocol
2021-07-20 16:05:57 -04:00
Sean DuBois
28df93f669 Expose Priority and Foundation overrides
Allow pion/webrtc to override these as well
2020-09-12 23:40:36 -07:00
Atsushi Watanabe
e670416dcc Fix random generators
Seeding random generator each time limits number of generated sequence
to 31-bits, and caused collision.
Use global random generator seeded by crypto grade random.

Use crypto/rand for cryptographic values,
and math/rand for unique identifier.
- Use UUIDv4 for mDNS name
- Use crypto/rand for ICE pwd and user fragment
- Use properly seeded math/rand for UDP port,
  tie breaker and candidate ID
2020-06-28 11:44:46 +09:00
Yutaka Takeda
c316a9f7b3 Fix lint errors
pion/webrtc#712
2019-07-15 01:00:21 -07:00
Hugo Arregui
b3e05469f0 Add vnet support with the new pion/turn client
Relates to pion/webrtc#712
2019-07-15 01:00:21 -07:00
Hugo Arregui
77a03cd608 Use config to create candidate
Use config objects to create candidates + add optional candidateID
2019-06-25 19:30:23 +00:00
Hugo Arregui
1ff70e0ee1 Initial stats
Add basic candidate and candidate pair stats
2019-06-22 11:55:06 +00:00
Sean DuBois
acbf5671b7 IP -> Address in public API
ICE RFC specifies this value as `Address` and not IP. We need to fix
this divergence to implement mDNS

Relates to pion/webrtc#699
2019-06-21 20:22:21 +08:00
Sean DuBois
b28205a1f1 Use ChannelBind for TURN Permissions
Wasteful to use just indications
2019-06-10 00:56:03 -07:00
Aleksandr Razumov
116ba6b111 Add turn client Close support
Fix the goroutine leak.
2019-06-07 20:42:39 -07:00
Sean DuBois
f335ea3cc2 Add E2E testing for Srflx and Relay candidates
Using pion/turn add tests for both candidates types

Resolves #47
2019-06-07 20:42:39 -07:00
Sean DuBois
2a96a308d5 Initial TURN implementation
This implementation is not fully tested, and we don't
handle all error case yet. We will continue to work on it though.

Tests for send/recv and shutdown are in the works.

Relates to #47
2019-05-27 23:30:50 -07:00
Sean DuBois
63b37975b6 Make Candidate an interface
This change will allow us to have custom logic and members
per interface type. Relay candidates will have a completely different
read loop, and candidate specific state.

Relates to #47
2019-05-24 15:55:42 -07:00