Class PeerConnectionConfiguration

java.lang.Object
tel.schich.libdatachannel.PeerConnectionConfiguration

public class PeerConnectionConfiguration extends Object
  • Field Details

  • Method Details

    • withIceServers

      public PeerConnectionConfiguration withIceServers(Collection<URI> iceServers)
      (optional): an array of pointers on null-terminated ICE server URIs (NULL if unused) Each entry in iceServers must match the format [("stun"|"turn"|"turns") (":"|"://")][username ":" password "@"]hostname[":" port]["?transport=" ("udp"|"tcp"|"tls")]. The default scheme is STUN, the default port is 3478 (5349 over TLS), and the default transport is UDP. For instance, a STUN server URI could be mystunserver.org, and a TURN server URI could be turn:myuser:12345678@turnserver.org. Note transports TCP and TLS are only available for a TURN server with libnice as ICE backend and govern only the TURN control connection, meaning relaying is always performed over UDP.
      Parameters:
      iceServers - the list of ICE servers
      Returns:
      fluent interface
    • iceServers

      public List<URI> iceServers()
    • withProxyServer

      public PeerConnectionConfiguration withProxyServer(URI proxyServer)
      (optional): if non-NULL, specifies the proxy server URI to use for TURN relaying (ignored with libjuice as ICE backend) TODO docs The proxyServer URI, if present, must match the format [("http"|"socks5") (":"|"://")][username ":" password "@"]hostname[":" port]. The default scheme is HTTP, and the default port is 3128 for HTTP or 1080 for SOCKS5. If the username or password of an URI contains reserved special characters, they must be percent-encoded. In particular, ":" must be encoded as "%3A" and "@" must by encoded as "%40".
      Parameters:
      proxyServer - the proxy URI
      Returns:
      fluent interface
    • proxyServer

      public Optional<URI> proxyServer()
    • withBindAddress

      public PeerConnectionConfiguration withBindAddress(InetAddress bindAddress)
      (optional): if non-NULL, bind only to the given local address (ignored with libnice as ICE backend)
      Parameters:
      bindAddress - the bind address
      Returns:
      fluent interface
    • bindAddress

      public Optional<InetAddress> bindAddress()
    • withCertificateType

      public PeerConnectionConfiguration withCertificateType(PeerConnectionConfiguration.CertificateType certificateType)
      (optional): certificate type, either RTC_CERTIFICATE_ECDSA or RTC_CERTIFICATE_RSA (0 or RTC_CERTIFICATE_DEFAULT if default)
      Parameters:
      certificateType - the certificate type
      Returns:
      fluent interface
    • certificateType

    • iceTransportPolicy

      public PeerConnectionConfiguration iceTransportPolicy(PeerConnectionConfiguration.IceTransportPolicy iceTransportPolicy)
      (optional): ICE transport policy, if set to RTC_TRANSPORT_POLICY_RELAY, the PeerConnection will emit only relayed candidates (0 or RTC_TRANSPORT_POLICY_ALL if default)
      Parameters:
      iceTransportPolicy - the transport policy
      Returns:
      fluent interface
    • iceTransportPolicy

    • withEnableIceTcp

      public PeerConnectionConfiguration withEnableIceTcp(boolean enableIceTcp)
      if true, generate TCP candidates for ICE (ignored with libjuice as ICE backend)
      Parameters:
      enableIceTcp - whether to enable TCP candidates
      Returns:
      fluent interface
    • enableIceTcp

      public boolean enableIceTcp()
    • withEnableIceUdpMux

      public PeerConnectionConfiguration withEnableIceUdpMux(boolean enableIceUdpMux)
      if true, connections are multiplexed on the same UDP port (should be combined with portRangeBegin and portRangeEnd, ignored with libnice as ICE backend)
      Parameters:
      enableIceUdpMux - whether to enable multiplexing on the same UDP port
      Returns:
      fluent interface
    • enableIceUdpMux

      public boolean enableIceUdpMux()
    • withDisableAutoNegotiation

      public PeerConnectionConfiguration withDisableAutoNegotiation(boolean disableAutoNegotiation)
      if true, the user is responsible for calling rtcSetLocalDescription after creating a Data Channel and after setting the remote description
      Parameters:
      disableAutoNegotiation - whether to disable auto negotiation
      Returns:
      fluent interface
    • disableAutoNegotiation

      public boolean disableAutoNegotiation()
    • withForceMediaTransport

      public PeerConnectionConfiguration withForceMediaTransport(boolean forceMediaTransport)
      if true, the connection allocates the SRTP media transport even if no tracks are present (necessary to add tracks during later renegotiation)
      Parameters:
      forceMediaTransport - whether to force the media transport
      Returns:
      fluent interface
    • forceMediaTransport

      public boolean forceMediaTransport()
    • withPortRangeBegin

      public PeerConnectionConfiguration withPortRangeBegin(int portRangeBegin)
      (optional): first port (included) of the allowed local port range, 1 to 65535 (0 if unused)
      Parameters:
      portRangeBegin - the beginning of the port range
      Returns:
      fluent interface
    • portRangeBegin

      public int portRangeBegin()
    • withPortRangeEnd

      public PeerConnectionConfiguration withPortRangeEnd(int portRangeEnd)
      (optional): last port (included) of the allowed local port range, 1 to 65535 (0 if unused)
      Parameters:
      portRangeEnd - the inclusive end of the port range
      Returns:
      fluent interface
    • portRangeEnd

      public int portRangeEnd()
    • withMtu

      public PeerConnectionConfiguration withMtu(int mtu)
      (optional): manually set the Maximum Transfer Unit (MTU) for the connection (0 if automatic)
      Parameters:
      mtu - the MTU
      Returns:
      fluent interface
    • mtu

      public int mtu()
    • withMaxMessageSize

      public PeerConnectionConfiguration withMaxMessageSize(int maxMessageSize)
      (optional): manually set the local maximum message size for Data Channels (0 if default)
      Parameters:
      maxMessageSize - the maximum message size
      Returns:
      fluent interface
    • maxMessageSize

      public int maxMessageSize()
    • uris

      public static Collection<URI> uris(String... uris)