pub struct Config {
pub bind: SocketAddr,
pub http_bind: Option<SocketAddr>,
pub auth_key: Option<PathBuf>,
pub auth_url: Option<Url>,
pub auth_public: Vec<Prefix>,
pub auth_public_publish: Vec<Prefix>,
pub auth_public_subscribe: Vec<Prefix>,
pub open_pulls: bool,
pub pull_limits: Limits,
pub iroh_policy: Option<Arc<dyn DynPolicy<EndpointId>>>,
}Expand description
Configuration for the media relay server, as clap arguments.
Fields§
§bind: SocketAddrBind address for WebTransport over QUIC.
http_bind: Option<SocketAddr>Bind address for the web viewer over HTTP.
Defaults to the –bind address, over TCP.
auth_key: Option<PathBuf>Grants token holders what their JWT allows, verified with the keys in this file.
This does not restrict sessions without a token. They keep the public
rules: browsers and iroh clients read every broadcast, browsers publish
under anon/, and iroh clients publish at the paths that name
their endpoint id. A valid token replaces those rules with its claims,
and lets the session pull the tickets whose paths it may read.
The file holds a JWK or a JWK set, as moq auth writes them. An
invalid token is refused. The media relay reads the file again when it
changes, so a rotated or removed key applies to new sessions without a
restart. Sessions already admitted keep their grant until their token
expires.
auth_url: Option<Url>Asks this auth server about every browser session, as moq-relay does.
auth_public: Vec<Prefix>Lets every browser session publish and subscribe under these prefixes, as moq-relay does.
A prefix covers its path and every path beneath it, and the empty
prefix "" covers every path. A wildcard such as anon/** is refused.
auth_public_publish: Vec<Prefix>Lets every browser session publish under these prefixes, as moq-relay does.
auth_public_subscribe: Vec<Prefix>Lets every browser session subscribe under these prefixes, as moq-relay does.
open_pulls: boolLets any session pull a ticket, with or without a token. Unsafe on a public media relay.
A session that names a broadcast ticket makes the media relay dial the ticket’s iroh endpoint. Without this flag, only a session whose token, verified with –auth-key, grants reading the ticket’s path may do that, so a media relay without –auth-key pulls nothing. With it, anyone who reaches the media relay can make it dial any endpoint, within the pull limits. Meant for local and development use.
pull_limits: LimitsBounds the pulls the media relay holds and starts.
Defaults to pull::Limits::default.
iroh_policy: Option<Arc<dyn DynPolicy<EndpointId>>>Decides the sessions of iroh clients, instead of the default.
The default is relay_policy, or with --auth-key a Verify of
the same keys with relay_policy as its fallback.
Trait Implementations§
Source§impl Args for Config
impl Args for Config
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl FromArgMatches for Config
impl FromArgMatches for Config
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Auto Trait Implementations§
impl !RefUnwindSafe for Config
impl !UnwindSafe for Config
impl Freeze for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more