Sets a callback function to receive AdditionalForwarding events.
Delegates to Tunnel#setAdditionalForwardingCallback.
The callback function to receive AdditionalForwarding events.
Sets a callback function to receive disconnected events.
Delegates to Tunnel#setTunnelDisconnectedCallback.
The callback function to receive disconnected events.
Sets a callback function to receive errors.
Delegates to Tunnel#setTunnelErrorCallback.
The callback function to receive errors.
Sets a callback function to receive Tunnel established events.
Delegates to Tunnel#setTunnelEstablishedCallback.
The callback function to receive Tunnel established events.
Sets a callback function to receive Forwarding changed events.
Delegates to Tunnel#setOnTunnelForwardingChanged.
The callback function to receive Forwarding change events.
Sets a callback function to receive usage updates.
Delegates to Tunnel#setUsageUpdateCallback.
The callback function to receive usage updates.
Registers a callback function to receive errors from the tunnel worker. It is recommended to always set this callback to ensure your program exits gracefully, since if the tunnel worker exits, the tunnel is no longer active.
The callback function to receive errors.
Retrieves Allow-Preflight configuration for this tunnel instance.
The Allow-Preflight sconfig
Gets the current argument string for the tunnel configuration.
Delegates to Config#getArgument.
The argument string, or null if unavailable.
Returns auto-reconnect configuration for this tunnel instance.
The auto-reconnect setting, or null if not configured.
Retrieves the basic authentication values from the instance configuration.
An array of basic auth credentials when configured, or null if none are set.
Returns bearer token authentication values defined in the configuration.
An array of bearer token strings if present; otherwise an empty array.
Returns the current tunnel configuration as a PinggyOptions object.
Extracts values from the instance and parses argument strings for advanced options.
The tunnel configuration, or null if unavailable.
Gets the current force configuration setting for the tunnel.
Delegates to Config#getForce.
The force setting, or null if unavailable.
Gets the forwarding rules configuration. Returns a JSON string containing all forwarding rules configured for this tunnel. Delegates to Config#getForwarding.
The tunnel type, or null if unavailable.
Returns header modification values defined in the configuration.
An array of header modification objects if present; otherwise null.
Returns whether HTTPS-only mode is enabled for the tunnel instance.
true if HTTPS-only mode is enabled, false if disabled, or null if the configuration is unavailable.
Retrieves IP whitelist for this tunnel instance.
An array of whitelisted IP addresses, or an empty array if no whitelist is configured.
Returns local server TLS configuration for this tunnel instance.
The local server TLS setting, or null if not configured.
Returns MaxReconnectAttempts configuration for this tunnel instance.
The MaxReconnectAttempts setting, or null if not configured.
Retrieves No-Reverse-Proxy configuration for this tunnel instance.
The No-Reverse-Proxy setting, or null if not configured.
Retrieves Original-Request-URL configuration for this tunnel instance.
The Original-Request-URL setting, or null if not configured.
Returns reconnect interval configuration for this tunnel instance.
The reconnect interval setting, or null if not configured.
Gets the current server address for the tunnel.
Delegates to Config#getServerAddress.
The server address, or null if unavailable.
Gets the current SNI server name for the tunnel.
Delegates to Config#getSniServerName.
The SNI server name, or null if unavailable.
Gets the current authentication token for the tunnel.
Delegates to Config#getToken.
The authentication token, or null if unavailable.
Gets the current SSL setting for the tunnel.
Delegates to Config#getTunnelSsl.
The SSL setting, or null if unavailable.
Gets the current tunnel state for the tunnel.
Delegates to Tunnel#GetTunnelState.
The tunnel state as a string.
Retrieves X-Forwarded-For configuration for this tunnel instance.
The X-Forwarded-For setting, or null if not configured.
StaticcreateCreates a new TunnelInstance with the specified options. Internally creates a TunnelWorkerManager, Config, and Tunnel.
Get greeting message for the tunnel.
Delegates to Tunnel#getTunnelGreetMessage.
The greeting message.
Get the latest usage statistics for the tunnel.
Delegates to Tunnel#getLatestUsage.
The latest usage statistics, or null if unavailable.
Gets the current status of the tunnel.
Returns the status from Tunnel#status.
The tunnel status.
Retrieves usage information from the underlying tunnel instance.
This method delegates to the tunnel's getTunnelUsages() implementation. If the tunnel is not initialized or its reference is missing, an Error is thrown.
The tunnel usages as a string, or null if no usages are available.
Checks if the tunnel is currently active.
Delegates to Tunnel#tunnelIsActive.
True if the tunnel is active, false otherwise.
Starts the tunnel and returns the public URLs.
Delegates to Tunnel#start.
Resolves with the list of public tunnel URLs.
Stops the tunnel and cleans up resources.
Delegates to Tunnel#tunnelStop.
Requests additional forwarding for the tunnel.
Delegates to Tunnel#tunnelRequestAdditionalForwarding.
The remote address to forward from.
The local address to forward to.
Gets the list of public URLs for the tunnel.
Delegates to Tunnel#getUrls.
The list of public tunnel URLs.
Enables or disables debug logging for the tunnel worker.
Returns the WebDebugger address for this tunnel instance.
Returns the WebDebugger information for this tunnel instance.
Returns WebDebuggerPort configuration for this tunnel instance.
The WebDebuggerPort setting, or null if not configured.
Starts web debugging for the tunnel on the specified local port.
Delegates to Tunnel#startWebDebugging.
The local port to start web debugging on.
Represents a high-level tunnel instance, managing both configuration and tunnel lifecycle. Provides methods to start, stop, and interact with a Pinggy tunnel.
Internally uses Config for configuration and Tunnel for tunnel management.