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.ObjectBuilder 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 aCreateTunnelin to a new Builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CreateTunnelbuild()CreateTunnel.BuilderwithAddr(int addr)SeewithAddr(String).CreateTunnel.BuilderwithAddr(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.BuilderwithAuth(java.lang.String auth)HTTP basic authentication credentials to enforce on tunneled requests.CreateTunnel.BuilderwithBasicAuth(java.util.List<java.lang.String> basicAuth)List of HTTP basic authentication credentials to enforce on tunneled requests.CreateTunnel.BuilderwithBindTls(boolean bindTls)SeewithBindTls(BindTls).CreateTunnel.BuilderwithBindTls(BindTls bindTls)CreateTunnel.BuilderwithCircuitBreaker(java.lang.Float circuitBreaker)The circuit breaker trigger.CreateTunnel.BuilderwithClientCas(java.lang.String clientCas)PEM TLS certificate authority at this path will verify incoming TLS client connection certificates.CreateTunnel.BuilderwithCompression(java.lang.Boolean compression)Whether compression is enabled on this tunnel.CreateTunnel.BuilderwithCrt(java.lang.String crt)PEM TLS certificate at this path to terminate TLS traffic before forwarding locally.CreateTunnel.BuilderwithHostHeader(java.lang.String hostHeader)Rewrite the HTTP Host header to this value, orpreserveto leave it unchanged.CreateTunnel.BuilderwithHostname(java.lang.String hostname)Hostname to request (requires reserved name and DNS CNAME).CreateTunnel.BuilderwithIpRestrictions(TunnelIPRestrictions ipRestrictions)The IP restrictions for the tunnel.CreateTunnel.BuilderwithKey(java.lang.String key)PEM TLS private key at this path to terminate TLS traffic before forwarding locally.CreateTunnel.BuilderwithMetadata(java.lang.String metadata)Arbitrary user-defined metadata that will appear in the ngrok service API when listing tunnels.CreateTunnel.BuilderwithMutualTlsCas(java.lang.String mutualTlsCas)The path to the TLS certificate authority to verify client certs.CreateTunnel.BuilderwithName(java.lang.String name)A friendly name for the tunnel, or the name of a ngrok tunnel definition to be used.CreateTunnel.BuilderwithNgrokVersion(NgrokVersion ngrokVersion)The major version ofngrokfor which the tunnel will be created.CreateTunnel.BuilderwithOAuth(TunnelOAuth oauth)Set of OAuth settings to enable OAuth authentication on the tunnel endpoint.CreateTunnel.BuilderwithoutInspect()Disable HTTP request inspection on tunnels.CreateTunnel.BuilderwithProto(Proto proto)The tunnel protocol, defaults toProto.HTTP.CreateTunnel.BuilderwithProxyProto(java.lang.String proxyProto)The proxy proto.CreateTunnel.BuilderwithRemoteAddr(java.lang.String remoteAddr)Bind the remote TCP port on the given address.CreateTunnel.BuilderwithRequestHeader(TunnelHeader requestHeader)The Headers to be added or removed from requests.CreateTunnel.BuilderwithResponseHeader(TunnelHeader responseHeader)The Headers to be added or removed from responses.CreateTunnel.BuilderwithSchemes(java.util.List<java.lang.String> schemes)The schemes to be bound.CreateTunnel.BuilderwithSubdomain(java.lang.String subdomain)Subdomain name to request.CreateTunnel.BuilderwithTerminateAt(java.lang.String terminateAt)The termination point.CreateTunnel.BuilderwithTunnelDefinition(java.util.Map<java.lang.String,java.lang.Object> tunnelDefinition)Populate anynullattributes (with the exception ofname) in this Builder with values from the giventunnelDefinition.CreateTunnel.BuilderwithVerifyWebhook(TunnelVerifyWebhook verifyWebhook)The signature for webhooks.CreateTunnel.BuilderwithWebsocketTcpConverter(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-trueto populate defaults.
-
Builder
public Builder(CreateTunnel createTunnel)
Copy aCreateTunnelin 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 ofngrokfor 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, orpreserveto 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 anynullattributes (with the exception ofname) in this Builder with values from the giventunnelDefinition.- Parameters:
tunnelDefinition- The map from whichnullattributes will be populated.
-
build
public CreateTunnel build()
-
-