public class CreateTunnel
extends java.lang.Object
ngrok
Tunnel creation request. This object can be serialized and passed to
the HttpClient
.
final NgrokClient ngrokClient = new NgrokClient.Builder().build(); final CreateTunnel createTunnel = new CreateTunnel.Builder() .withName("my-tunnel") .withProto(Proto.TCP) .withAddr(5000) .build(); final Tunnel httpTunnel = ngrokClient.connect(createTunnel);
ngrok
Version Compatibilityjava-ngrok
is compatible with ngrok
v2 and v3, but by default it will install v3. To
install v2 instead, set the version with
JavaNgrokConfig.Builder.withNgrokVersion(NgrokVersion)
and
CreateTunnel.Builder.withNgrokVersion(NgrokVersion)
.Modifier and Type | Class and Description |
---|---|
static class |
CreateTunnel.Builder
Builder for a
CreateTunnel , which can be used to construct a request that conforms to ngrok 's tunnel definition. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAddr()
Get the local port to which the tunnel will forward traffic.
|
java.lang.String |
getAuth()
Get HTTP basic authentication credentials enforced on tunnel requests.
|
java.util.List<java.lang.String> |
getBasicAuth()
Get the list of HTTP basic authentication credentials to enforce on tunneled requests.
|
BindTls |
getBindTls()
Get
ngrok 's bind_tls value. |
java.lang.Float |
getCircuitBreaker()
Get the circuit breaker trigger.
|
java.lang.String |
getCrt()
Get the PEM TLS certificate path that will be used to terminate TLS traffic before forwarding locally.
|
java.lang.String |
getDomain()
Get the tunnel domain.
|
java.lang.String |
getHostHeader()
Get the HTTP Host header.
|
TunnelIPRestriction |
getIpRestriction()
Get the IP restrictions for the tunnel.
|
java.lang.String |
getKey()
Get the PEM TLS private key path that will be used to terminate TLS traffic before forwarding locally.
|
java.util.List<java.lang.String> |
getLabels()
Get the labels.
|
java.lang.String |
getMetadata()
Get the arbitrary user-defined metadata that will appear in the ngrok service API when listing tunnels.
|
java.lang.String |
getMutualTlsCas()
Get the path to the TLS certificate authority to verify client certs.
|
java.lang.String |
getName()
Get the name of the tunnel.
|
NgrokVersion |
getNgrokVersion()
Get the version of
ngrok for which the tunnel was created. |
TunnelOAuth |
getOauth()
Get the OAuth settings to be setup on the tunnel.
|
TunnelPolicy |
getPolicyInbound()
Get the inbound policy.
|
TunnelPolicy |
getPolicyOutbound()
Get the outbound policy.
|
Proto |
getProto()
Get the tunnel protocol.
|
java.lang.String |
getProxyProto()
Get the proxy proto.
|
java.lang.String |
getRemoteAddr()
Get the bound remote TCP port on the given address.
|
TunnelHeader |
getRequestHeader()
Get the Headers to be added or removed from requests.
|
TunnelHeader |
getResponseHeader()
Get the Headers to be added or removed from responses.
|
java.util.List<java.lang.String> |
getSchemes()
Get the schemes to be bound.
|
java.lang.String |
getSubdomain()
Get the subdomain.
|
java.lang.String |
getTerminateAt()
Get the termination point.
|
TunnelUserAgentFilter |
getUserAgentFilter()
Get the UserAgent filters.
|
TunnelVerifyWebhook |
getVerifyWebhook()
Get the signature for webhooks.
|
java.lang.Boolean |
isCompression()
Whether compression is enabled on this tunnel.
|
java.lang.Boolean |
isInspect()
Whether HTTP request inspection on tunnels is enabled.
|
java.lang.Boolean |
isPoolingEnabled()
Whether pooling is enabled on this tunnel.
|
java.lang.Boolean |
isWebsocketTcpConverter()
Whether ingress connections are converted to TCP upstream.
|
public NgrokVersion getNgrokVersion()
ngrok
for which the tunnel was created.public java.lang.String getName()
public Proto getProto()
public java.lang.String getDomain()
public java.lang.String getAddr()
public java.lang.Boolean isInspect()
public java.lang.String getAuth()
public java.lang.String getHostHeader()
public BindTls getBindTls()
ngrok
's bind_tls
value.public java.lang.String getSubdomain()
public java.lang.String getCrt()
public java.lang.String getKey()
public java.lang.String getRemoteAddr()
public java.lang.String getMetadata()
public java.util.List<java.lang.String> getSchemes()
public java.util.List<java.lang.String> getBasicAuth()
public TunnelOAuth getOauth()
public java.lang.Float getCircuitBreaker()
public java.lang.Boolean isCompression()
public java.lang.String getMutualTlsCas()
public java.lang.String getProxyProto()
public java.lang.Boolean isWebsocketTcpConverter()
public java.lang.String getTerminateAt()
public TunnelHeader getRequestHeader()
public TunnelHeader getResponseHeader()
public TunnelIPRestriction getIpRestriction()
public TunnelVerifyWebhook getVerifyWebhook()
public TunnelUserAgentFilter getUserAgentFilter()
public TunnelPolicy getPolicyInbound()
public TunnelPolicy getPolicyOutbound()
public java.util.List<java.lang.String> getLabels()
ngrok
config file and not the
Builder.public java.lang.Boolean isPoolingEnabled()