Module com.github.alexdlaird.ngrok
Class CreateTunnel.Builder
- java.lang.Object
-
- com.github.alexdlaird.ngrok.protocol.CreateTunnel.Builder
-
- Enclosing class:
- CreateTunnel
public static class CreateTunnel.Builder extends java.lang.Object
Builder for aCreateTunnel
, which can be used to construct a request that conforms tongrok
's tunnel definition. See docs for that class for example usage.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Use this constructor if default values should not be populated in required attributes whenbuild()
is called.Builder(boolean setDefaults)
Use this constructor if default values should be populated in required attributes whenbuild()
is called.Builder(CreateTunnel createTunnel)
Copy aCreateTunnel
in to a new Builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CreateTunnel
build()
CreateTunnel.Builder
withAddr(int addr)
SeewithAddr(String)
.CreateTunnel.Builder
withAddr(java.lang.String addr)
The local port to which the tunnel will forward traffic, or a local directory or network address, defaults to "80".CreateTunnel.Builder
withAuth(java.lang.String auth)
HTTP basic authentication credentials to enforce on tunneled requests.CreateTunnel.Builder
withBasicAuth(java.util.List<java.lang.String> basicAuth)
List of HTTP basic authentication credentials to enforce on tunneled requests.CreateTunnel.Builder
withBindTls(boolean bindTls)
SeewithBindTls(BindTls)
.CreateTunnel.Builder
withBindTls(BindTls bindTls)
CreateTunnel.Builder
withCircuitBreaker(java.lang.Float circuitBreaker)
The circuit breaker trigger.CreateTunnel.Builder
withClientCas(java.lang.String clientCas)
PEM TLS certificate authority at this path will verify incoming TLS client connection certificates.CreateTunnel.Builder
withCompression(java.lang.Boolean compression)
Whether compression is enabled on this tunnel.CreateTunnel.Builder
withCrt(java.lang.String crt)
PEM TLS certificate at this path to terminate TLS traffic before forwarding locally.CreateTunnel.Builder
withHostHeader(java.lang.String hostHeader)
Rewrite the HTTP Host header to this value, orpreserve
to leave it unchanged.CreateTunnel.Builder
withHostname(java.lang.String hostname)
Hostname to request (requires reserved name and DNS CNAME).CreateTunnel.Builder
withIpRestrictions(TunnelIPRestrictions ipRestrictions)
The IP restrictions for the tunnel.CreateTunnel.Builder
withKey(java.lang.String key)
PEM TLS private key at this path to terminate TLS traffic before forwarding locally.CreateTunnel.Builder
withMetadata(java.lang.String metadata)
Arbitrary user-defined metadata that will appear in the ngrok service API when listing tunnels.CreateTunnel.Builder
withMutualTlsCas(java.lang.String mutualTlsCas)
The path to the TLS certificate authority to verify client certs.CreateTunnel.Builder
withName(java.lang.String name)
A friendly name for the tunnel, or the name of a ngrok tunnel definition to be used.CreateTunnel.Builder
withNgrokVersion(NgrokVersion ngrokVersion)
The major version ofngrok
for which the tunnel will be created.CreateTunnel.Builder
withOAuth(TunnelOAuth oauth)
Set of OAuth settings to enable OAuth authentication on the tunnel endpoint.CreateTunnel.Builder
withoutInspect()
Disable HTTP request inspection on tunnels.CreateTunnel.Builder
withProto(Proto proto)
The tunnel protocol, defaults toProto.HTTP
.CreateTunnel.Builder
withProxyProto(java.lang.String proxyProto)
The proxy proto.CreateTunnel.Builder
withRemoteAddr(java.lang.String remoteAddr)
Bind the remote TCP port on the given address.CreateTunnel.Builder
withRequestHeader(TunnelHeader requestHeader)
The Headers to be added or removed from requests.CreateTunnel.Builder
withResponseHeader(TunnelHeader responseHeader)
The Headers to be added or removed from responses.CreateTunnel.Builder
withSchemes(java.util.List<java.lang.String> schemes)
The schemes to be bound.CreateTunnel.Builder
withSubdomain(java.lang.String subdomain)
Subdomain name to request.CreateTunnel.Builder
withTerminateAt(java.lang.String terminateAt)
The termination point.CreateTunnel.Builder
withTunnelDefinition(java.util.Map<java.lang.String,java.lang.Object> tunnelDefinition)
Populate anynull
attributes (with the exception ofname
) in this Builder with values from the giventunnelDefinition
.CreateTunnel.Builder
withVerifyWebhook(TunnelVerifyWebhook verifyWebhook)
The signature for webhooks.CreateTunnel.Builder
withWebsocketTcpConverter(java.lang.Boolean websocketTcpConverter)
Whether ingress connections are converted to TCP upstream.
-
-
-
Constructor Detail
-
Builder
public Builder()
Use this constructor if default values should not be populated in required attributes whenbuild()
is called.If required attributes are not set in the built
CreateTunnel
, default values will be used in methods likeNgrokClient.connect(CreateTunnel)
.
-
Builder
public Builder(boolean setDefaults)
Use this constructor if default values should be populated in required attributes whenbuild()
is called.- Parameters:
setDefaults
-true
to populate defaults.
-
Builder
public Builder(CreateTunnel createTunnel)
Copy aCreateTunnel
in to a new Builder. Using this constructor will also set default attributes whenbuild()
is called.- Parameters:
createTunnel
- The CreateTunnel to copy.
-
-
Method Detail
-
withNgrokVersion
public CreateTunnel.Builder withNgrokVersion(NgrokVersion ngrokVersion)
The major version ofngrok
for which the tunnel will be created.
-
withName
public CreateTunnel.Builder withName(java.lang.String name)
A friendly name for the tunnel, or the name of a ngrok tunnel definition to be used.
-
withProto
public CreateTunnel.Builder withProto(Proto proto)
The tunnel protocol, defaults toProto.HTTP
.
-
withAddr
public CreateTunnel.Builder withAddr(java.lang.String addr)
The local port to which the tunnel will forward traffic, or a local directory or network address, defaults to "80".
-
withAddr
public CreateTunnel.Builder withAddr(int addr)
SeewithAddr(String)
.
-
withoutInspect
public CreateTunnel.Builder withoutInspect()
Disable HTTP request inspection on tunnels.
-
withAuth
public CreateTunnel.Builder withAuth(java.lang.String auth)
HTTP basic authentication credentials to enforce on tunneled requests.
-
withHostHeader
public CreateTunnel.Builder withHostHeader(java.lang.String hostHeader)
Rewrite the HTTP Host header to this value, orpreserve
to leave it unchanged.
-
withBindTls
public CreateTunnel.Builder withBindTls(BindTls bindTls)
-
withBindTls
public CreateTunnel.Builder withBindTls(boolean bindTls)
SeewithBindTls(BindTls)
.
-
withSubdomain
public CreateTunnel.Builder withSubdomain(java.lang.String subdomain)
Subdomain name to request. If unspecified, uses the tunnel name.
-
withHostname
public CreateTunnel.Builder withHostname(java.lang.String hostname)
Hostname to request (requires reserved name and DNS CNAME).
-
withCrt
public CreateTunnel.Builder withCrt(java.lang.String crt)
PEM TLS certificate at this path to terminate TLS traffic before forwarding locally.
-
withKey
public CreateTunnel.Builder withKey(java.lang.String key)
PEM TLS private key at this path to terminate TLS traffic before forwarding locally.
-
withClientCas
public CreateTunnel.Builder withClientCas(java.lang.String clientCas)
PEM TLS certificate authority at this path will verify incoming TLS client connection certificates.
-
withRemoteAddr
public CreateTunnel.Builder withRemoteAddr(java.lang.String remoteAddr)
Bind the remote TCP port on the given address.
-
withMetadata
public CreateTunnel.Builder withMetadata(java.lang.String metadata)
Arbitrary user-defined metadata that will appear in the ngrok service API when listing tunnels.
-
withSchemes
public CreateTunnel.Builder withSchemes(java.util.List<java.lang.String> schemes)
The schemes to be bound.
-
withBasicAuth
public CreateTunnel.Builder withBasicAuth(java.util.List<java.lang.String> basicAuth)
List of HTTP basic authentication credentials to enforce on tunneled requests.
-
withOAuth
public CreateTunnel.Builder withOAuth(TunnelOAuth oauth)
Set of OAuth settings to enable OAuth authentication on the tunnel endpoint.
-
withCircuitBreaker
public CreateTunnel.Builder withCircuitBreaker(java.lang.Float circuitBreaker)
The circuit breaker trigger.
-
withCompression
public CreateTunnel.Builder withCompression(java.lang.Boolean compression)
Whether compression is enabled on this tunnel.
-
withMutualTlsCas
public CreateTunnel.Builder withMutualTlsCas(java.lang.String mutualTlsCas)
The path to the TLS certificate authority to verify client certs.
-
withProxyProto
public CreateTunnel.Builder withProxyProto(java.lang.String proxyProto)
The proxy proto.
-
withWebsocketTcpConverter
public CreateTunnel.Builder withWebsocketTcpConverter(java.lang.Boolean websocketTcpConverter)
Whether ingress connections are converted to TCP upstream.
-
withTerminateAt
public CreateTunnel.Builder withTerminateAt(java.lang.String terminateAt)
The termination point.
-
withRequestHeader
public CreateTunnel.Builder withRequestHeader(TunnelHeader requestHeader)
The Headers to be added or removed from requests.
-
withResponseHeader
public CreateTunnel.Builder withResponseHeader(TunnelHeader responseHeader)
The Headers to be added or removed from responses.
-
withIpRestrictions
public CreateTunnel.Builder withIpRestrictions(TunnelIPRestrictions ipRestrictions)
The IP restrictions for the tunnel.
-
withVerifyWebhook
public CreateTunnel.Builder withVerifyWebhook(TunnelVerifyWebhook verifyWebhook)
The signature for webhooks.
-
withTunnelDefinition
public CreateTunnel.Builder withTunnelDefinition(java.util.Map<java.lang.String,java.lang.Object> tunnelDefinition)
Populate anynull
attributes (with the exception ofname
) in this Builder with values from the giventunnelDefinition
.- Parameters:
tunnelDefinition
- The map from whichnull
attributes will be populated.
-
build
public CreateTunnel build()
-
-