pub struct TcpTransport { /* private fields */ }Expand description
A SocketTransport that opens TCP connections, with TLS from the
start for secureTransport: "on" and after startTls() for
"starttls".
Pair it with a SocketPolicy in a SocketService: the policy
authorizes the names JavaScript connects to, and this transport resolves
them and refuses any resolved address that is not public, such as
loopback, private and link-local networks, unless
allow_private_addresses. A name that
resolves to no allowed address fails with PermissionDenied.
Connecting and relaying run on the Tokio runtime that polls the host
pump; an App without one fails each connect with Configuration. TLS
verifies the server against the Mozilla roots in webpki-roots, or the
configuration from with_tls_config.
Implementations§
Source§impl TcpTransport
impl TcpTransport
Sourcepub fn new() -> Self
pub fn new() -> Self
Connect to public addresses, verifying TLS servers against the
webpki-roots certificates.
Sourcepub fn with_tls_config(config: Arc<ClientConfig>) -> Self
pub fn with_tls_config(config: Arc<ClientConfig>) -> Self
Connect to public addresses, using config for TLS, such as one
that trusts a private certificate authority.
Sourcepub fn allow_private_addresses(self) -> Self
pub fn allow_private_addresses(self) -> Self
Also connect to loopback, private and other non-public addresses, for a host whose services run beside it, such as a database on the same network.