File size: 1,073 Bytes
06555b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from dataclasses import dataclass
from typing import List, Optional


@dataclass
class RTCIceServer:
    """

    The :class:`RTCIceServer` dictionary defines how to connect to a single

    STUN or TURN server. It includes both the URL and the necessary credentials,

    if any, to connect to the server.

    """

    urls: str
    """

    This required property is either a single string or a list of strings,

    each specifying a URL which can be used to connect to the server.

    """
    username: Optional[str] = None
    "The username to use during authentication (for TURN only)."
    credential: Optional[str] = None
    "The credential to use during authentication (for TURN only)."
    credentialType: str = "password"


@dataclass
class RTCConfiguration:
    """

    The :class:`RTCConfiguration` dictionary is used to provide configuration

    options for an :class:`RTCPeerConnection`.

    """

    iceServers: Optional[List[RTCIceServer]] = None
    "A list of :class:`RTCIceServer` objects to configure STUN / TURN servers."