Skip to content

Commit

Permalink
Add ip_filter type
Browse files Browse the repository at this point in the history
  • Loading branch information
mickel8 committed Sep 20, 2024
1 parent d29d025 commit 4c51906
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/ex_ice/ice_agent.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,18 @@ defmodule ExICE.ICEAgent do
| {:data, binary()}
| {:new_candidate, String.t()}}

@typedoc """
Filter applied when gathering host candidates.
"""
@type ip_filter() :: (:inet.ip_address() -> boolean)

@typedoc """
ICE Agent configuration options.
All notifications are by default sent to a process that spawns `ExICE`.
This behavior can be overwritten using the following options.
* `ip_filter` - filter applied when gathering local candidates
* `ports` - ports that will be used when gathering local candidates, otherwise the ports are chosen by the OS
* `ip_filter` - filter applied when gathering host candidates
* `ports` - ports that will be used when gathering host candidates, otherwise the ports are chosen by the OS
* `ice_servers` - list of STUN/TURN servers
* `ice_transport_policy` - candidate types to be used.
* `all` - all ICE candidates will be considered (default).
Expand All @@ -62,7 +67,7 @@ defmodule ExICE.ICEAgent do
however, remote relay candidates work correctly.
"""
@type opts() :: [
ip_filter: (:inet.ip_address() -> boolean),
ip_filter: ip_filter(),
ports: Enumerable.t(non_neg_integer()),
ice_servers: [
%{
Expand Down

0 comments on commit 4c51906

Please sign in to comment.