Skip to main content

TurnHooksServer

Trait TurnHooksServer 

Source
pub trait TurnHooksServer: Send + Sync {
    // Provided methods
    fn get_password<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        realm: &'life1 str,
        username: &'life2 str,
        algorithm: PasswordAlgorithm,
    ) -> Pin<Box<dyn Future<Output = Result<Credential, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn on_allocated<'life0, 'async_trait>(
        &'life0 self,
        id: String,
        username: String,
        port: u16,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn on_channel_bind<'life0, 'async_trait>(
        &'life0 self,
        id: String,
        username: String,
        channel: u16,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn on_create_permission<'life0, 'async_trait>(
        &'life0 self,
        id: String,
        username: String,
        ports: Vec<u16>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn on_refresh<'life0, 'async_trait>(
        &'life0 self,
        id: String,
        username: String,
        lifetime: u32,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn on_destroy<'life0, 'async_trait>(
        &'life0 self,
        id: String,
        username: String,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn start_with_server<'life0, 'async_trait>(
        self,
        server: &'life0 mut Server,
        listen: SocketAddr,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: Sized + 'static + 'async_trait,
             'life0: 'async_trait { ... }
}

Provided Methods§

Source

fn get_password<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, realm: &'life1 str, username: &'life2 str, algorithm: PasswordAlgorithm, ) -> Pin<Box<dyn Future<Output = Result<Credential, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn on_allocated<'life0, 'async_trait>( &'life0 self, id: String, username: String, port: u16, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

allocate request

rfc8489

In all cases, the server SHOULD only allocate ports from the range 49152 - 65535 (the Dynamic and/or Private Port range [PORT-NUMBERS]), unless the TURN server application knows, through some means not specified here, that other applications running on the same host as the TURN server application will not be impacted by allocating ports outside this range. This condition can often be satisfied by running the TURN server application on a dedicated machine and/or by arranging that any other applications on the machine allocate ports before the TURN server application starts. In any case, the TURN server SHOULD NOT allocate ports in the range 0 - 1023 (the Well- Known Port range) to discourage clients from using TURN to run standard services.

Source

fn on_channel_bind<'life0, 'async_trait>( &'life0 self, id: String, username: String, channel: u16, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

channel bind request

rfc8489

If the request is valid, but the server is unable to fulfill the request due to some capacity limit or similar, the server replies with a 508 (Insufficient Capacity) error.

Otherwise, the server replies with a ChannelBind success response. There are no required attributes in a successful ChannelBind response.

Source

fn on_create_permission<'life0, 'async_trait>( &'life0 self, id: String, username: String, ports: Vec<u16>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

create permission request

rfc8489

If the request is valid, but the server is unable to fulfill the request due to some capacity limit or similar, the server replies with a 508 (Insufficient Capacity) error.

Otherwise, the server replies with a ChannelBind success response. There are no required attributes in a successful ChannelBind response.

Source

fn on_refresh<'life0, 'async_trait>( &'life0 self, id: String, username: String, lifetime: u32, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

refresh request

rfc8489

If the request is valid, but the server is unable to fulfill the request due to some capacity limit or similar, the server replies with a 508 (Insufficient Capacity) error.

Otherwise, the server replies with a ChannelBind success response. There are no required attributes in a successful ChannelBind response.

Source

fn on_destroy<'life0, 'async_trait>( &'life0 self, id: String, username: String, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

session closed

Triggered when the session leaves from the turn. Possible reasons: the session life cycle has expired, external active deletion, or active exit of the session.

Source

fn start_with_server<'life0, 'async_trait>( self, server: &'life0 mut Server, listen: SocketAddr, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: Sized + 'static + 'async_trait, 'life0: 'async_trait,

start the turn hooks server

This function will start the turn hooks server on the given server and listen address.

Implementors§