Class IceServer

java.lang.Object
com.codename1.webrtc.IceServer

public final class IceServer extends Object

A STUN or TURN server a PeerConnection may use to find a path to the other side.

A STUN server only tells a device its public address, so it needs no credentials. A TURN server relays the media when no direct path exists -- behind a carrier NAT or a strict firewall, which is common on mobile networks -- and is normally given short-lived credentials by the app's own server.

  • Constructor Details

    • IceServer

      public IceServer(String[] urls, String username, String credential)
      Parameters
      • urls: one or more stun:, turn: or turns: URLs for the same server

      • username: the TURN user name, or null for STUN

      • credential: the TURN password, or null for STUN

  • Method Details

    • stun

      public static IceServer stun(String url)
      A server with no credentials, such as a public STUN server.
    • getUrls

      public String[] getUrls()
    • getUsername

      public String getUsername()
    • getCredential

      public String getCredential()