Struct ngrok::prelude::TcpTunnelBuilder
source · pub struct TcpTunnelBuilder { /* private fields */ }
Expand description
A builder for a tunnel backing a TCP endpoint.
https://ngrok.com/docs/tcp/
Implementations§
source§impl TcpTunnelBuilder
impl TcpTunnelBuilder
The options for a TCP edge.
sourcepub fn allow_cidr(&mut self, cidr: impl Into<String>) -> &mut Self
pub fn allow_cidr(&mut self, cidr: impl Into<String>) -> &mut Self
Add the provided CIDR to the allowlist.
https://ngrok.com/docs/tcp/ip-restrictions/
sourcepub fn deny_cidr(&mut self, cidr: impl Into<String>) -> &mut Self
pub fn deny_cidr(&mut self, cidr: impl Into<String>) -> &mut Self
Add the provided CIDR to the denylist.
https://ngrok.com/docs/tcp/ip-restrictions/
sourcepub fn proxy_proto(&mut self, proxy_proto: ProxyProto) -> &mut Self
pub fn proxy_proto(&mut self, proxy_proto: ProxyProto) -> &mut Self
Sets the PROXY protocol version for connections over this tunnel.
sourcepub fn metadata(&mut self, metadata: impl Into<String>) -> &mut Self
pub fn metadata(&mut self, metadata: impl Into<String>) -> &mut Self
Sets the opaque metadata string for this tunnel.
https://ngrok.com/docs/api/resources/tunnels/#tunnel-fields
sourcepub fn binding(&mut self, binding: impl Into<String>) -> &mut Self
pub fn binding(&mut self, binding: impl Into<String>) -> &mut Self
Sets the ingress configuration for this endpoint
sourcepub fn forwards_to(&mut self, forwards_to: impl Into<String>) -> &mut Self
pub fn forwards_to(&mut self, forwards_to: impl Into<String>) -> &mut Self
Sets the ForwardsTo string for this tunnel. This can be viewed via the API or dashboard.
This overrides the default process info if using TunnelBuilder::listen, and is in turn overridden by the url provided to ForwarderBuilder::listen_and_forward.
https://ngrok.com/docs/api/resources/tunnels/#tunnel-fields
sourcepub fn verify_upstream_tls(&mut self, verify_upstream_tls: bool) -> &mut Self
pub fn verify_upstream_tls(&mut self, verify_upstream_tls: bool) -> &mut Self
Disables backend TLS certificate verification for forwards from this tunnel.
sourcepub fn remote_addr(&mut self, remote_addr: impl Into<String>) -> &mut Self
pub fn remote_addr(&mut self, remote_addr: impl Into<String>) -> &mut Self
Sets the TCP address to request for this edge.
https://ngrok.com/docs/network-edge/domains-and-tcp-addresses/#tcp-addresses
sourcepub fn policy<S>(&mut self, s: S) -> Result<&mut Self, S::Error>
pub fn policy<S>(&mut self, s: S) -> Result<&mut Self, S::Error>
DEPRECATED: use traffic_policy instead.
sourcepub fn traffic_policy(&mut self, policy_str: impl Into<String>) -> &mut Self
pub fn traffic_policy(&mut self, policy_str: impl Into<String>) -> &mut Self
Set policy for this edge.
Trait Implementations§
source§impl Clone for TcpTunnelBuilder
impl Clone for TcpTunnelBuilder
source§fn clone(&self) -> TcpTunnelBuilder
fn clone(&self) -> TcpTunnelBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl ForwarderBuilder for TcpTunnelBuilder
impl ForwarderBuilder for TcpTunnelBuilder
source§fn listen_and_forward<'life0, 'async_trait>(
&'life0 self,
to_url: Url
) -> Pin<Box<dyn Future<Output = Result<Forwarder<TcpTunnel>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn listen_and_forward<'life0, 'async_trait>(
&'life0 self,
to_url: Url
) -> Pin<Box<dyn Future<Output = Result<Forwarder<TcpTunnel>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
source§impl From<Session> for TcpTunnelBuilder
impl From<Session> for TcpTunnelBuilder
source§impl TunnelBuilder for TcpTunnelBuilder
impl TunnelBuilder for TcpTunnelBuilder
Auto Trait Implementations§
impl Freeze for TcpTunnelBuilder
impl !RefUnwindSafe for TcpTunnelBuilder
impl Send for TcpTunnelBuilder
impl Sync for TcpTunnelBuilder
impl Unpin for TcpTunnelBuilder
impl !UnwindSafe for TcpTunnelBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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