View Source ExICE.URI (ex_ice v0.6.1)

Module representing STUN URI.

Implementation of RFC 7064.

We could try to use URI module from Elixir but RFC 7064 states:

While these two ABNF productions are defined in [RFC3986] as components of the generic hierarchical URI, this does not imply that the "stun" and "stuns" URI schemes are hierarchical URIs. Developers MUST NOT use a generic hierarchical URI parser to parse a "stun" or "stuns" URI.

Summary

Functions

Parses URI string into t/0.

Types

@type scheme() :: :stun | :stuns
@type t() :: %ExICE.URI{host: String.t(), port: :inet.port_number(), scheme: scheme()}

Functions

@spec parse(String.t()) :: {:ok, t()} | :error

Parses URI string into t/0.