How do I specify turn servers in livekit.yaml?
# ask-ai
m
How do I specify turn servers in livekit.yaml?
g
To specify TURN servers in
livekit.yaml
, you need to configure the
turn
section. According to the LiveKit deployment documentation, you can enable TURN and specify the domain, ports, and other settings. Here's an example configuration:
Copy code
turn:
  enabled: true
  domain: <turn.myhost.com>
  tls_port: 5349
  udp_port: 3478
  cert_file: /path/to/turn.crt
  key_file: /path/to/turn.key
This configuration enables TURN, sets the domain, and specifies the ports for TLS and UDP. The certificate and key files are used for TLS termination. Would you like more details on configuring TURN servers? Sources: - LiveKit Deployment Configuration 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
m
@millions-hair-24956 I can use google turn servers?
g
It seems likely that you can use external TURN servers, such as Google's, with LiveKit by specifying them in the
ice_servers
list within the
rtc_config
section of your configuration. According to the LiveKit RTC Configuration documentation, you can define a list of ICE servers, which includes TURN servers, to be used for establishing connections. Here's an example of how you might configure this:
Copy code
rtc:
  ice_servers:
    - urls: ["turn:your-turn-server-url"]
      username: "your-username"
      credential: "your-credential"
This configuration allows you to specify external TURN servers, including those provided by Google, by adding their URLs and credentials. Would you like more detailed guidance on setting this up? Sources: - LiveKit RTC Configuration documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
m
@millions-hair-24956 I get an error: line 12: field ice_servers not found in type config.RTCConfig
g
It seems likely that the error you're encountering is due to a mismatch in the configuration structure. The
ice_servers
field should be part of the
RTCConfiguration
class, not directly under
rtc_config
. According to the LiveKit RTC Configuration documentation, the
rtc_config
should be an instance of
RtcConfiguration
, which includes
ice_servers
as a property. Here's how you might correctly structure your configuration:
Copy code
rtc_config:
  ice_servers:
    - urls: ["turn:your-turn-server-url"]
      username: "your-username"
      credential: "your-credential"
Ensure that
rtc_config
is properly defined as an instance of
RtcConfiguration
in your code. Would you like more detailed assistance on resolving this error? Sources: - LiveKit RTC Configuration documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.