Allow users to pass in a static MulticastDNSHostName, this can be used to
connect peers in a LAN without signaling. If you set a static uFrag/uPwd
on either side and have a static hostname you can gather without knowing
an IP Address on either side.
Add local credential support to the AgentConfig and
validate credentials per RFC standard. If no credentials
are passed we still generate random ones ourselves.
Before we have a hard limit of 50, this will fall down if users
has more local/remote candidates then we expect.
Resolves#122
Co-authored-by: Sean DuBois <sean@siobud.com>
Allow the agent to run in Lite mode. This is useful in
cases where you never want connectivity checks, and reduces
possible attacks surfaces when you have a public IP.
When trickle is enabled do a connectivity check everytime a candidate
is added. Because we have a new candidate there is a chance we could
have a success this time.
Close the connection when we have connected. There is no
benefit to leaving it open, but some risk. This allows
us to avoid fingerprinting and port exhaustion that might
come up when running lots of peers
Relates to pion/webrtc#699
Add helper function to add localCandidates. Brings down the duplication
and make sure we have a properly formed checklist when we are doing
trickle.
When comparing candidates in findPair do by value, and not address.
Before some candidates were failing to be found because of this.
This implements a basic validation schema using a checklist. We try
every pair at least maxTries, and mark it as failed if we don't get a
success response after that many requests. Once we get a success
response, we check if it belongs to the best candidate available so far,
if it does we nominate it, otherwise we continue.
Also, after a given timeout, if no candidate has been nominated, we
simply choose the best valid candidate we got so far (if no candidate is
valid, we mark the connection as failed).
Finally, the nomination request also has a maximum of maxTries, we mark
the connection as failed if after that many attempt we fail to get a
success response.
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
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
When we get an inbound message assert these values, also discard any
other packet types besides binding. In the future we should extend to
handle inbound error messages
Resolves#19Resolves#21
Connectivity checks are done via a Ticker, the inital tick does not
happen immediately (by design) causing the startup time to be the
Duration the Ticker is created with.
This change adds another chan forceCandidateContact that can be used to
force contact at anytime. Currently it is only called on startup, but
could be useful in the future for reuse.
Resolve#15
Some constants were being incorrectly generated using 2^N (XOR)
instead of 1 << N. This resulted in incorrect candidate priorities
being used to evaluate candidate pairs.
Resolves#14.