Function flytrap::private_address

source ·
pub fn private_address() -> Option<Ipv6Addr>
Available on crate features detect or environment only.
Expand description

Read the $FLY_PRIVATE_IP environment variable, if set to a valid IPv6 address.

If the detect crate feature is enabled (default) and $FLY_PRIVATE_IP is unset, looks for a local network interface with a Fly.io private IPv6 address (starting with fdaa:), and returns that address.

Returns None if $FLY_PRIVATE_IP is unset, empty, or Ipv6Addr cannot parse it.