pub struct DirectServerConfig {
pub listen: SocketAddr,
pub advertise: SocketAddr,
}Fields§
§listen: SocketAddrUDP address the STUN service binds.
advertise: SocketAddrPublic address announced to clients. Port 0 takes the bound port. An unspecified IP announces only the port: each client then uses the relay IP it dialed, which is right whenever the UDP port is forwarded like the TCP one, including behind cloud 1:1 NAT where the host never sees its public IP.
Implementations§
Source§impl DirectServerConfig
impl DirectServerConfig
Sourcepub fn on_relay_port(ip: IpAddr, port: u16) -> Self
pub fn on_relay_port(ip: IpAddr, port: u16) -> Self
Direct coordination on the relay’s own port number over UDP, announcing only that port: each client pairs it with the relay address it dialed.
Sourcepub fn probe_relay_port(ip: IpAddr, port: u16) -> Result<Self>
pub fn probe_relay_port(ip: IpAddr, port: u16) -> Result<Self>
Self::on_relay_port if that UDP port can be bound now, so that a
relay asked for no direct service in particular can still start,
relay-only, when the port is taken. The probe socket is closed again
before this returns.
Trait Implementations§
Source§impl Clone for DirectServerConfig
impl Clone for DirectServerConfig
Auto Trait Implementations§
impl Forget for DirectServerConfig
impl Freeze for DirectServerConfig
impl Move for DirectServerConfig
impl RefUnwindSafe for DirectServerConfig
impl Send for DirectServerConfig
impl Sync for DirectServerConfig
impl Unpin for DirectServerConfig
impl UnsafeUnpin for DirectServerConfig
impl UnwindSafe for DirectServerConfig
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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