Skip to main content

Module turn

Module turn 

Source
Expand description

Fetches TURN credentials from an external provider.

One set of credentials is shared by every user and renewed after half its lifetime, so the provider sees a bounded number of requests however many clients ask. A failed fetch pauses further attempts for a minute, while any unexpired credentials keep being served.

Re-exportsยง

use std::module_path; ๐Ÿ”’
use std::sync::Arc; ๐Ÿ”’
use std::time::Duration; ๐Ÿ”’
use std::time::Instant; ๐Ÿ”’
use async_trait::async_trait; ๐Ÿ”’
use ruma::api::client::voip::get_turn_server_info::v3::Response as Credentials; ๐Ÿ”’
use tokio::sync::Mutex; ๐Ÿ”’
use tuwunel_core::Error; ๐Ÿ”’
use tuwunel_core::Result; ๐Ÿ”’
use tuwunel_core::config::turn::Provider; ๐Ÿ”’
use tuwunel_core::err; ๐Ÿ”’
use tuwunel_core::implement; ๐Ÿ”’
use tuwunel_core::warn; ๐Ÿ”’
use crate::Args; ๐Ÿ”’
use crate::SelfServices; ๐Ÿ”’
use crate::service::make_name; ๐Ÿ”’

Modulesยง

provider ๐Ÿ”’
Requests TURN credentials from the configured provider.

Structsยง

Cache ๐Ÿ”’
Entry ๐Ÿ”’
Service
Shares one set of externally issued TURN credentials among all users.

Enumsยง

Lookup ๐Ÿ”’
What the cache offers a caller.

Constantsยง

RETRY_DELAY ๐Ÿ”’
Pause after a failed fetch before the provider is asked again.

Functionsยง

origin ๐Ÿ”’
Identifies the provider cached credentials came from.
unavailable ๐Ÿ”’