> Markdown version of https://tuna.am/en/docs/cli/tcp/. Documentation index: [llms.txt](https://tuna.am/en/llms.txt), full text in one file: [llms-full.txt](https://tuna.am/en/llms-full.txt). Any page is available as Markdown: append `.md` to its URL without the trailing slash.

# tuna tcp

Start a TCP tunnel.

Guide with examples: [TCP](https://tuna.am/en/docs/tunnels/tcp.md).

Usage

```bash
tuna tcp [port] [flags]

```

Examples

```bash
tuna tcp 5432
tuna tcp 10.0.0.1:5432
tuna tcp 5432 --port=postgres
tuna tcp 5432 --port=35000
tuna tcp unix:///var/run/docker.sock

```

| Flag                      | Description                                                               |
| ------------------------- | ------------------------------------------------------------------------- |
| `--api-key string`        | Your tuna.am api key with the tunnels:connect scope (env `TUNA_API_KEY`). |
| `--cidr-allow string`     | Reject connections that do not match the given CIDRs. Can be repeated.    |
| `--cidr-deny string`      | Reject connections that match the given CIDRs. Can be repeated.           |
| `-p, --port string`       | Port for incoming connections.                                            |
| `--proxy-protocol string` | Version of PROXY Protocol (1 or 2).                                       |
| `--qr`                    | Generate and show QR code.                                                |

[Global flags](https://tuna.am/en/docs/cli.md#global-flags) work too.
