# PROXY Protocol support in TCP tunnels

January 28, 2026 ·

<!-- -->

2 min read

The [console client](https://tuna.am/en/docs/guides/install/install-cli.md) **tuna** has added support for [PROXY Protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) for TCP tunnels. Now you can pass the original client IP address and port directly to your application.

```shell
$ tuna tcp 54321 --proxy-protocol=2
INFO[22:08:58] Welcome to Tuna
INFO[22:09:00] Forwarding tcp://ru.tuna.am:22347 -> 127.0.0.1:54321

```

[Go to documentation](https://tuna.am/en/docs/tunnels/tcp.md#proxy-protocol)

## Why do you need PROXY Protocol?

When using tunnels, your application sees connections from the tunnel server rather than from the real client. PROXY Protocol solves this problem — it passes the original client IP and port in the connection header, which allows you to:

* Keep correct connection logs with real IP addresses
* Apply access control rules at the application level
* Collect accurate analytics on user geography

## New flag

The `tuna tcp` command has a new `--proxy-protocol` flag that accepts the protocol version:

| Value | Format | Description                                |
| ----- | ------ | ------------------------------------------ |
| `1`   | Text   | Human-readable format, easy to debug       |
| `2`   | Binary | More efficient, recommended for production |

## Usage examples

### Basic example

```shell
tuna tcp 8443 --proxy-protocol=1
# or with an environment variable
TUNA_PROXY_PROTOCOL=1 tuna tcp 8443

```

### Minecraft server

Some game server builds, for example [Velocity](https://docs.papermc.io/velocity/configuration/#advanced-section), support PROXY Protocol. Enable it in the game config and in the tuna client:

```shell
tuna tcp 45678 --proxy-protocol=2

```

## Compatibility

PROXY Protocol is widely supported by popular server software:

* **Haproxy** — supports both versions, detects automatically
* **Nginx** — supports both versions, detects automatically
* **Envoy** — supports both versions
* Many databases and applications via a proxy layer

tip

If you're not sure which version to choose — use version `2`. The binary format is more efficient and is the recommended option in most cases.

## Updating

To update, follow the [instructions](https://tuna.am/en/docs/guides/update.md).

## Leave feedback

If you enjoy using Tuna, or on the contrary you are not happy with something, please [leave feedback](https://my.tuna.am/?show_feedback=1).

![](/blog/img/2024-08-22/feedback.gif)

## Help

We value our users and carefully review every request. If you have any problems with tuna, please contact us in one of the following ways:

* [Email](mailto:info@tuna.am)
* [Telegram community](https://telegram.me/+Kgbtt0_gJwI5ZmEy)

**Tags:**

* [release](https://tuna.am/en/blog/tags/release)
* [tuna](https://tuna.am/en/blog/tags/tuna)
* [cli](https://tuna.am/en/blog/tags/cli)
