Class SdpUtil

java.lang.Object
org.cloudburstmc.netty.util.nethernet.SdpUtil

public final class SdpUtil extends Object
Helpers for the SDP documents exchanged during signalling.
  • Method Details

    • candidateAddress

      public static String candidateAddress(String candidate)
      The connection address of an a=candidate: line, or null if it has none.

      The grammar of RFC 5245 section 15.1 puts the address in the fifth token, after the foundation, component, transport and priority.

      Parameters:
      candidate - The candidate line
      Returns:
      The address it points at
    • withAdvertisedCandidates

      public static String withAdvertisedCandidates(String sdp, Set<String> allowed)
      Drops every ICE candidate whose address is not in allowed.

      ICE gathers a candidate on every interface it can see, which on a host network includes container and overlay addresses that are unreachable from outside. Each one costs the remote peer a round of connectivity checks before it gives up, so a host that knows which of its addresses are reachable can announce only those. If nothing would be left the description is returned untouched, since no candidates at all can never connect.

      Parameters:
      sdp - The description to filter
      allowed - The addresses that may be announced, empty to announce everything
      Returns:
      The filtered description