Interface Config

Configuration object to pass to ngrok.forward()

Hierarchy

  • Config

Properties

addr?: string | number

Port, network address, url, or named pipe. Defaults to 80. Examples: "80", "localhost:8080", "https://192.168.1.100:8443", "unix:/tmp/my.sock", "pipe://./my-pipe"

allow_user_agent?: string | string[]

A set of regular expressions used to match User-Agents that will be allowed. On request, the User Agent Filter module will check the incoming User-Agent header value against the list of defined allow and deny regular expression rules. See User Agent Filter_ in the ngrok docs for additional details.

.. _User Agent Filter: https://ngrok.com/docs/cloud-edge/modules/user-agent-filter/

app_protocol?: string

The L7 application protocol to use for this edge, e.g. "http2" or "http1".

auth?: string | string[]
authtoken?: string

Configures the session to authenticate with the provided authtoken. You can find your existing authtoken or create a new one in the ngrok dashboard.

See the authtoken parameter in the ngrok docs for additional details.

authtoken_from_env?: boolean

Shortcut for calling [SessionBuilder::authtoken] with the value of the NGROK_AUTHTOKEN environment variable.

basic_auth?: string | string[]

Credentials for basic authentication, with username and password colon separated.

binPath?: string

Unused, will warn and be ignored

circuit_breaker?: number

Reject requests when 5XX responses exceed this ratio. Disabled when 0. See Circuit Breaker in the ngrok docs for additional details.

compression?: boolean

Enable gzip compression for HTTP responses. See Compression in the ngrok docs for additional details.

configPath?: string

Unused, will warn and be ignored

crt?: string

The certificate to use for TLS termination at the ngrok edge in PEM format. Only used if "proto" is "tls". See TLS Termination in the ngrok docs for additional details.

deny_user_agent?: string | string[]

A set of regular expressions used to match User-Agents that will be denied. On request, the User Agent Filter module will check the incoming User-Agent header value against the list of defined allow and deny regular expression rules. See User Agent Filter_ in the ngrok docs for additional details.

.. _User Agent Filter: https://ngrok.com/docs/cloud-edge/modules/user-agent-filter/

domain?: string

The domain to request for this edge, 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.

forwards_to?: string

Returns a human-readable string presented in the ngrok dashboard and the API.

host?: string

The hostname for the listener to forward to. Only used if addr is not defined.

host_header?: string

Unused, will warn and be ignored

hostname?: string

Synonym for domain

inspect?: string

Unused, will warn and be ignored

ip_restriction_allow_cidrs?: string | string[]

Restriction placed on the origin of incoming connections to the edge to only allow these CIDR ranges.

ip_restriction_deny_cidrs?: string | string[]

Restriction placed on the origin of incoming connections to the edge to deny these CIDR ranges.

key?: string

The certificate to use for TLS termination at the ngrok edge in PEM format. Only used if "proto" is "tls". See TLS Termination in the ngrok docs for additional details.

labels?: string | string[]

Add label, value pairs for this listener, colon separated.

metadata?: string

Listener-specific opaque metadata. Viewable via the API.

mutual_tls_cas?: string | string[]

Certificates to use for client authentication at the ngrok edge. Only used if "proto" is "tls" or "http". See Mutual TLS in the ngrok docs for additional details.

name?: string

Unused, will warn and be ignored

oauth_allow_domains?: string | string[]

OAuth configuration of domains to allow. See OAuth in the ngrok docs for additional details.

oauth_allow_emails?: string | string[]

OAuth configuration of email addresses to allow. See OAuth in the ngrok docs for additional details.

oauth_client_id?: string

OAuth configuration of client ID. Required for scopes. See OAuth in the ngrok docs for additional details.

oauth_client_secret?: string

OAuth configuration of client secret. Required for scopes. See OAuth in the ngrok docs for additional details.

oauth_provider?: string

OAuth configuration of the provider, e.g. "google". See OAuth in the ngrok docs for additional details.

oauth_scopes?: string | string[]

OAuth configuration of scopes. See OAuth in the ngrok docs for additional details.

oidc_allow_domains?: string | string[]

OIDC configuration of domains to allow. See OpenID Connect in the ngrok docs for additional details.

oidc_allow_emails?: string | string[]

OIDC configuration of email addresses to allow. See OpenID Connect in the ngrok docs for additional details.

oidc_client_id?: string

OIDC configuration of client ID. See OpenID Connect in the ngrok docs for additional details.

oidc_client_secret?: string

OIDC configuration of client secret. See OpenID Connect in the ngrok docs for additional details.

oidc_issuer_url?: string

OIDC configuration of the issuer URL. See OpenID Connect in the ngrok docs for additional details.

oidc_scopes?: string | string[]

OIDC configuration of scopes. See OpenID Connect in the ngrok docs for additional details.

onLogEvent?: ((data) => void)

Type declaration

    • (data): void
    • Returns log messages from the ngrok library.

      Parameters

      • data: string

      Returns void

onStatusChange?: ((status) => void)

Type declaration

    • (status): void
    • 'closed' - connection is lost, 'connected' - reconnected

      Parameters

      • status: string

      Returns void

policy?: string

The Traffic Policy to use for this endpoint.

port?: number

The port for the listener to forward to. Only used if addr is not defined.

proto?: string

The type of listener to use, one of http|tcp|tls|labeled, defaults to http.

proxy_proto?: string

The version of PROXY protocol to use with this listener "1", "2", or "" if not using.

region?: string

Unused, will warn and be ignored

remote_addr?: string

The TCP address to request for this edge. These addresses can be reserved in the ngrok dashboard to use across sessions. For example: remote_addr("2.tcp.ngrok.io:21746") Only used if proto is "tcp".

request_header_add?: string | string[]

Adds a header to all requests to this edge. See Request Headers in the ngrok docs for additional details.

request_header_remove?: string | string[]

Removes a header from requests to this edge. See Request Headers in the ngrok docs for additional details.

response_header_add?: string | string[]

Adds a header to all responses coming from this edge. See Response Headers in the ngrok docs for additional details.

response_header_remove?: string | string[]

Removes a header from responses from this edge. See Response Headers in the ngrok docs for additional details.

schemes?: string | string[]

The scheme that this edge should use. "HTTPS" or "HTTP", defaults to "HTTPS". If multiple are given only the last one is used.

session_metadata?: string

Configures the opaque, machine-readable metadata string for this session. Metadata is made available to you in the ngrok dashboard and the Agents API resource. It is a useful way to allow you to uniquely identify sessions. We suggest encoding the value in a structured format like JSON.

See the metdata parameter in the ngrok docs for additional details.

subdomain?: string

Unused, use domain instead, will warn and be ignored

terminate_at?: string

Unused, will warn and be ignored

verify_webhook_provider?: string

WebhookVerification configuration, the provider to use. See Webhook Verification in the ngrok docs for additional details.

verify_webhook_secret?: string

WebhookVerification configuration, the secret to use. See Webhook Verification in the ngrok docs for additional details.

web_addr?: string

Unused, will warn and be ignored

websocket_tcp_converter?: boolean

Convert incoming websocket connections to TCP-like streams.

Generated using TypeDoc