Package com.ngrok

Class HttpBuilder

    • Method Detail

      • scheme

        public HttpBuilder scheme​(Http.Scheme scheme)
        Sets the scheme for this HTTP endpoint. The default scheme is Http.Scheme.HTTPS.
        Parameters:
        scheme - the scheme
        Returns:
        the builder instance
      • domain

        public HttpBuilder domain​(String domain)
        Sets the domain to request for this HTTP endpoint. Any valid domain or hostname that you have previously registered with ngrok. If using a custom domain, this requires registering in the ngrok dashboard and setting a DNS CNAME value.
        Parameters:
        domain - the domain
        Returns:
        the builder instance
      • mutualTLSCA

        public HttpBuilder mutualTLSCA​(byte[] mutualTLSCA)
        Sets the certificates to use for client authentication for this HTTP endpoint.
        Parameters:
        mutualTLSCA - the TLS certificate, in bytes
        Returns:
        the builder instance
        See Also:
        Mutual TLS in the ngrok docs for additional details.
      • compression

        public HttpBuilder compression()
        Enables HTTP response compression for this HTTP endpoint.
        Returns:
        the builder instance
        See Also:
        Compression in the ngrok docs for additional details.
      • websocketTcpConversion

        public HttpBuilder websocketTcpConversion()
        Enables Websocket to TCP conversion for this HTTP endpoint.
        Returns:
        the builder instance
        See Also:
        Websocket TCP Converter in the ngrok docs for additional details.
      • circuitBreaker

        public HttpBuilder circuitBreaker​(double value)
        Sets the circuit breaker value for this HTTP endpoint. ngrok will reject requests when 5XX responses exceed this ratio.
        Parameters:
        value - the circuit breaker value, between 0 and 1
        Returns:
        the builder instance
        See Also:
        Circuit Breaker in the ngrok docs for additional details.
      • addRequestHeader

        public HttpBuilder addRequestHeader​(String name,
                                            String value)
        Adds a header to the list of added request headers for this HTTP endpoint.
        Parameters:
        name - the name of the header to add
        value - the value of the header to add
        Returns:
        the builder instance
        See Also:
        Request Headers in the ngrok docs for additional details.
      • addResponseHeader

        public HttpBuilder addResponseHeader​(String name,
                                             String value)
        Adds a header to the list of added response headers for this HTTP endpoint.
        Parameters:
        name - the name of the header to add
        value - the value of the header to add
        Returns:
        the builder instance
        See Also:
        Response Headers in the ngrok docs for additional details.
      • removeRequestHeader

        public HttpBuilder removeRequestHeader​(String name)
        Adds a header to the list of removed request headers for this HTTP endpoint.
        Parameters:
        name - the name of the header to remove
        Returns:
        the builder instance
        See Also:
        Request Headers in the ngrok docs for additional details.
      • removeResponseHeader

        public HttpBuilder removeResponseHeader​(String name)
        Adds a header to the list of removed response headers for this HTTP endpoint.
        Parameters:
        name - the name of the header to remove
        Returns:
        the builder instance
        See Also:
        Response Headers in the ngrok docs for additional details.
      • basicAuthOptions

        public HttpBuilder basicAuthOptions​(Http.BasicAuth options)
        Sets basic authentication for this HTTP endpoint.
        Parameters:
        options - the basic authentication options
        Returns:
        the builder instance
        See Also:
        Basic Auth in the ngrok docs for additional details.
      • oauthOptions

        public HttpBuilder oauthOptions​(Http.OAuth options)
        Sets OAuth for this HTTP endpoint.
        Parameters:
        options - the OAuth options
        Returns:
        the builder instance
        See Also:
        OAuth in the ngrok docs for additional details.
      • oidcOptions

        public HttpBuilder oidcOptions​(Http.OIDC options)
        Sets OIDC for this HTTP endpoint.
        Parameters:
        options - the OIDC options
        Returns:
        the builder instance
        See Also:
        OpenID Connect in the ngrok docs for additional details.
      • webhookVerification

        public HttpBuilder webhookVerification​(Http.WebhookVerification webhookVerification)
        Sets webhook verification for this HTTP endpoint.
        Parameters:
        webhookVerification - the webhook verification options
        Returns:
        the builder instance
        See Also:
        Webhook Verification in the ngrok docs for additional details.
      • getScheme

        public Http.Scheme getScheme()
        Returns the scheme for this HTTP endpoint.
        Returns:
        the scheme
      • getSchemeName

        public Optional<String> getSchemeName()
        Returns the scheme name for this HTTP endpoint.
        Returns:
        the scheme name, either empty, HTTPS or HTTP
      • getDomain

        public Optional<String> getDomain()
        Returns the domain on this HTTP endpoint.
        Returns:
        the domain
      • getMutualTLSCA

        public byte[] getMutualTLSCA()
        Returns the certificates to use for client authentication for this HTTP endpoint.
        Returns:
        the TLS certificates, in bytes.
      • isCompression

        public boolean isCompression()
        Returns whether compression is enabled for this HTTP endpoint.
        Returns:
        true if compression is enabled, false otherwise
      • isWebsocketTcpConversion

        public boolean isWebsocketTcpConversion()
        Returns whether WebSocket to TCP conversion is enabled for this HTTP endpoint.
        Returns:
        true if WebSocket to TCP conversion is enabled, false otherwise
      • getCircuitBreaker

        public Optional<Double> getCircuitBreaker()
        Returns the circuit breaker value for this HTTP endpoint.
        Returns:
        the circuit breaker value
      • getRequestHeaders

        public List<Http.Header> getRequestHeaders()
        Returns the list of request headers to add for this HTTP endpoint.
        Returns:
        the list of headers
      • getResponseHeaders

        public List<Http.Header> getResponseHeaders()
        Returns the list of response headers to add for this HTTP endpoint.
        Returns:
        the list of headers
      • getRemoveRequestHeaders

        public List<String> getRemoveRequestHeaders()
        Returns the list of request headers to remove for this HTTP endpoint.
        Returns:
        the list of headers
      • getRemoveResponseHeaders

        public List<String> getRemoveResponseHeaders()
        Returns the list of response headers to remove for this HTTP endpoint.
        Returns:
        the list of headers
      • getBasicAuth

        public Http.BasicAuth getBasicAuth()
        Returns the basic authentication options for this HTTP endpoint.
        Returns:
        the basic authentication options
      • getOauth

        public Http.OAuth getOauth()
        Returns the OAuth options for this HTTP endpoint.
        Returns:
        the OAuth options
      • getOidc

        public Http.OIDC getOidc()
        Returns the OIDC options for this HTTP endpoint.
        Returns:
        the OIDC options
      • getWebhookVerification

        public Http.WebhookVerification getWebhookVerification()
        Returns the webhook verification options for this HTTP endpoint.
        Returns:
        the webhook verification options