vkma.devRU

OpenTunnel: a stable address without an account

On this page

opentunnel is the default provider. It forwards TLS without reading it, so the key never leaves your machine, no account is needed and HTTPS needs no setup.

A stable address

The address does not change between runs. The package stores the identity per profile, by default the project directory’s name. A directory name without Latin letters or digits becomes project-<hash>, so two such projects do not share an address. A URL wired into the VK app settings therefore keeps working.

The identity lives in $XDG_DATA_HOME/vkma/tunnel/<profile>.json with mode 0600.

The first run

On the first run the package waits for the certificate to be issued. On the hosted service this can take several minutes, and the terminal shows progress lines (waiting-certificate…).

Profiles

vkma-tunnel --profile my-app        # another profile, another address
vkma-tunnel list                    # what is stored
vkma-tunnel reset --profile my-app  # delete the identity

After reset the old URL stops working, and the next run issues a new one. reset --all deletes the identities of every profile.

A profile belongs to one provider. When cloudflared in token mode owns a profile, opentunnel refuses to run under it, and the other way round. Pick another --profile.

Your own address and server

The provider’s settings live in the opentunnel section of the config, and in the CLI they carry the --opentunnel- prefix:

Setting Flag Meaning
route --opentunnel-route "@" (default) gives https://<id>.opentunnel.xyz; a subdomain label gives https://<label>.<id>.opentunnel.xyz
api --opentunnel-api a self-hosted opentunnel server, for example https://opentunnel.example; the OPENTUNNEL_API environment variable works too

Speed

With opentunnel TLS ends on your machine, not at the service’s server. Every request travels from the service’s server through a relay to your machine, so on a long path an answer takes hundreds of milliseconds. That is how the provider works. When speed matters, use Cloudflare Tunnel.

Dropped connections

When the network fails halfway, the connection to the service drops without a close from its side, and the service keeps the route bound to the old session for a while. The terminal shows route held by another bridge (@), taking over…. The connection recovers by itself, so wait it out.

To keep the connection from idling, the CLI and the plugin send a small request through the tunnel every 20 seconds. Turn it off with --no-keepalive or with keepAlive: false.

Next

vkma.dev
RU
Esc