Advanced Options for HTTP(S) tunnels

Some advanced options to allow CORS preflight requests bypass authentication, add X-Forwarded headers, etc.

Reverse proxy mode

For some servers, it is important to have X-Forwarded-For, X-Forwarded-Host, and X-Forwarded-Proto headers to be set. For setting all of them together, you can use the reverse proxy mode. It also sets the SNI to a proper value in case you are connecting to a local HTTPS server.

You can enable reverse proxy mode with the x:reverseproxy:HostName command line argument. Change the HostName to the hostname required to connect to your local server, for example localhost.

Add X-Forwarded-For header to every request

X-Forwarded-For is a mechanism to finding out the source (IP and Port) of the connection. Pinggy HTTP(S) tunnel does not implicitly add the this flag. However, user can enable X-Forwarded-For header with x:xff command line argument.

If you want to change the header name from X-Forwarded-For to something custom such as Source-Address, you can also do so using the argument: x:xff:Source-Address.

Allow CORS preflight requests

By default, enabling key authentication / password authentication will block all unauthenticated requests to Pinggy URLs. But sometimes the CORS preflight requests are required to be sent through to enable CORS. In those cases you can use the x:passpreflight argument.

Pinggy allows users to manipulate headers via the command line. The syntax is as follows:

Forcefully disconnect existing tunnel and create a new tunnel

By default, trying to connect to establish a tunnel with a token which is already in use by another active tunnel will produce the error “Login is not allowed: A tunnel with the same token (xxYYzzZ) is already active.”

In such cases, in order to terminate the tunnel, you can use the “Terminate” option in “Active Tunnels” page in https://dashboard.pinggy.io/

If you want to programatically disconnect an existing tunnel to forcefully create a new one, you may use the force option as follows.