XTurn Plugins

Example data-plane plugins for xturn.

Home: https://github.com/Lazarus404/xturn-plugins

Hex: https://hex.pm/packages/xturn_plugins

What problem this solves

TURN relays forward media between WebRTC clients and peers. Operators often need abuse filtering and usage metrics on that path. This package ships two plugins that implement the xturn-plugin-api contract without depending on the full xturn application (so they build and test standalone).

Installation

def deps do
[
{:xturn_plugins, "~> 0.1"}
]
end

Main modules

RFCs

Usage

config :xturn,
plugins: [
{Xirsys.XTurn.Plugin.Guard, mode: :monitor, payload_types: [0, 8]},
{Xirsys.XTurn.Plugin.Metrics, flush_ms: 5_000}
]

Guard defaults to :monitor (telemetry only, never drops) so it is safe to deploy before switching to :enforce. Default payload_types: [0, 8] covers PCMU/PCMA; set it explicitly for WebRTC deployments using dynamic payload types (Opus, VP8, and others).

Tests

cd xturn-plugins
mix test

Tests drive each plugin's callbacks directly against xturn_plugin_api Allocation/Frame structs.

Changelog

See CHANGELOG.md.

License

Apache-2.0. See LICENSE.md.