---
name: internalapp-tunnel
description: "Expose a local development server through InternalApp when the user explicitly asks for a public tunnel, webhook URL, or remote preview."
---

# InternalApp Tunnel

Use InternalApp to expose a local service through standard OpenSSH. Preserve the short default command and add options only when they solve a stated need.

## Safety gate

Before starting a tunnel, identify the local port and what it serves. Obtain human confirmation unless the user already explicitly requested that exact service be exposed. Never expose databases, admin panels, debug consoles, private files, or unauthenticated sensitive applications without a clear warning and confirmation.

## Start a tunnel

For a local HTTP server on local port 3000:

```sh
ssh -R 80:localhost:3000 ssh.internalapp.cn -- --anonymous
```

The platform picks a random address; no account is needed. `--anonymous` is required: it opens the site to anyone with the URL, and a tunnel started without it (or with `-N`) is closed and its site deleted. Do not add `-N`. To keep a stable address, sign in to the console, register an SSH key and create a site.

Read the public URL from the SSH output and report it to the user. Keep the process attached or supervise it so it can be stopped cleanly. Do not claim the tunnel works until the public URL returns the expected application.

If outbound port 22 is blocked:

```sh
ssh -p 443 -R 80:localhost:3000 ssh.internalapp.cn -- --anonymous
```

If the local framework rejects the public Host header, add a site-level Host override after the host. It is saved on the site and applies to later connections too (site options need a registered key, see below):

```sh
ssh -R 80:localhost:3000 ssh.internalapp.cn -- --host-header=localhost:3000
```

The `--` after the host is required: without it OpenSSH tries to read `--host-header` as one of its own options and fails with "illegal option" (macOS) or "unrecognized option" (Linux). Put it before the first site option; it applies to all of them.

Other site options (`--auth platform,password`, `--password=<password>`, `--anonymous`, `--approve-visitor <email>`, `--accept-access-request`) change who may open the site. To pre-approve several visitors, repeat `--approve-visitor <email>`. Omitted options keep their saved value. Use them only when the user asked for that access rule.

Site options, including `--host-header`, are only available once the user has registered their SSH public key to an account on the platform. A tunnel opened anonymously cannot change site settings or require visitors to sign in with the platform or a password; the tunnel is closed, except for the bare `--anonymous` shown above. In that case, ask the user to add their key in the console first.

## Host identity

Never disable SSH host-key checking or automatically delete known-host entries. The current host key fingerprint is:

```text
SHA256:3w1GdtgKxMsRKOdR4nuFvDML5LkiVeIykJTzE9XE9Oc
```

If the fingerprint differs, stop and ask the user to verify it in the console at https://internalapp.cn/dashboard.

## Cleanup

Stop the SSH process when the preview or webhook test is complete. Confirm the public URL no longer reaches the local service when cleanup matters.

For sites, keys and access settings, use the console at https://internalapp.cn/dashboard.
