Struct ngrok::config::HttpTunnelBuilder
source · pub struct HttpTunnelBuilder { /* private fields */ }
Expand description
A builder for a tunnel backing an HTTP endpoint.
Implementations§
source§impl HttpTunnelBuilder
impl HttpTunnelBuilder
sourcepub fn allow_cidr(self, cidr: impl Into<String>) -> Self
pub fn allow_cidr(self, cidr: impl Into<String>) -> Self
Add the provided CIDR to the allowlist.
sourcepub fn proxy_proto(self, proxy_proto: ProxyProto) -> Self
pub fn proxy_proto(self, proxy_proto: ProxyProto) -> Self
Sets the PROXY protocol version for connections over this tunnel.
sourcepub fn metadata(self, metadata: impl Into<String>) -> Self
pub fn metadata(self, metadata: impl Into<String>) -> Self
Sets the opaque metadata string for this tunnel.
sourcepub fn forwards_to(self, forwards_to: impl Into<String>) -> Self
pub fn forwards_to(self, forwards_to: impl Into<String>) -> Self
Sets the ForwardsTo string for this tunnel. This can be viewed via the API or dashboard.
sourcepub fn domain(self, domain: impl Into<String>) -> Self
pub fn domain(self, domain: impl Into<String>) -> Self
Sets the domain to request for this edge.
sourcepub fn mutual_tlsca(self, mutual_tlsca: Bytes) -> Self
pub fn mutual_tlsca(self, mutual_tlsca: Bytes) -> Self
Adds a certificate in PEM format to use for mutual TLS authentication.
These will be used to authenticate client certificates for requests at the ngrok edge.
sourcepub fn compression(self) -> Self
pub fn compression(self) -> Self
Enables gzip compression.
sourcepub fn websocket_tcp_conversion(self) -> Self
pub fn websocket_tcp_conversion(self) -> Self
Enables the websocket-to-tcp converter.
sourcepub fn circuit_breaker(self, circuit_breaker: f64) -> Self
pub fn circuit_breaker(self, circuit_breaker: f64) -> Self
Sets the 5XX response ratio at which the ngrok edge will stop sending requests to this tunnel.
sourcepub fn request_header(
self,
name: impl Into<String>,
value: impl Into<String>
) -> Self
pub fn request_header( self, name: impl Into<String>, value: impl Into<String> ) -> Self
Adds a header to all requests to this edge.
sourcepub fn response_header(
self,
name: impl Into<String>,
value: impl Into<String>
) -> Self
pub fn response_header( self, name: impl Into<String>, value: impl Into<String> ) -> Self
Adds a header to all responses coming from this edge.
sourcepub fn remove_request_header(self, name: impl Into<String>) -> Self
pub fn remove_request_header(self, name: impl Into<String>) -> Self
Removes a header from requests to this edge.
sourcepub fn remove_response_header(self, name: impl Into<String>) -> Self
pub fn remove_response_header(self, name: impl Into<String>) -> Self
Removes a header from responses from this edge.
sourcepub fn basic_auth(
self,
username: impl Into<String>,
password: impl Into<String>
) -> Self
pub fn basic_auth( self, username: impl Into<String>, password: impl Into<String> ) -> Self
Adds the provided credentials to the list of basic authentication credentials.
sourcepub fn oauth(self, oauth: OauthOptions) -> Self
pub fn oauth(self, oauth: OauthOptions) -> Self
Set the OAuth configuraton for this edge.
sourcepub fn oidc(self, oidc: OidcOptions) -> Self
pub fn oidc(self, oidc: OidcOptions) -> Self
Set the OIDC configuration for this edge.
Trait Implementations§
source§impl Clone for HttpTunnelBuilder
impl Clone for HttpTunnelBuilder
source§fn clone(&self) -> HttpTunnelBuilder
fn clone(&self) -> HttpTunnelBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more