> For the complete documentation index, see [llms.txt](https://learn.netmaker.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.netmaker.io/features/gateways/tcp-uplink.md). Agents can also search and read this documentation through its [MCP server](https://learn.netmaker.io/~gitbook/mcp).

# TCP uplink

Reach relays and gateways over encrypted WebSockets when UDP is blocked.

TCP uplink lets clients reach a relay or gateway when WireGuard UDP is blocked.

Instead of UDP, the client opens an encrypted WebSocket connection to the gateway. The gateway remains a normal WireGuard peer for the mesh.

### When to use it

Use TCP uplink when a firewall blocks UDP to the relay or gateway. The network must allow outbound TCP/TLS, typically on port `443`.

### How it works

1. Enable TCP uplink on the gateway.
2. The gateway listens on `/uplink/v1`.
3. Clients connect to the published gateway address with `wss://`.
4. After authentication, WireGuard packets use the WebSocket uplink session.

### TLS options

| Mode                  | Use when                                          | Client address                                    |
| --------------------- | ------------------------------------------------- | ------------------------------------------------- |
| Self-signed (default) | The gateway terminates TLS.                       | `wss://<gateway>:<port>/uplink/v1`                |
| Reverse proxy         | Caddy, nginx, Ingress, or similar terminates TLS. | `wss://<public-hostname>:<public-port>/uplink/v1` |

#### Self-signed

1. Enable TCP uplink on the gateway.
2. Choose a listen port, commonly `443`.
3. Allow clients to reach the port.
4. Trust the gateway certificate on each client.

Netmaker publishes a certificate fingerprint for self-signed gateways.

Clients dial `wss://<gateway-ip-or-host>:<port>/uplink/v1`.

#### Behind a reverse proxy

1. Bind the uplink listener to an internal address and port. For example, `127.0.0.1:51822`.
2. Set TLS mode to **proxy**. The gateway then serves plain WebSocket traffic behind TLS termination.
3. Set the public hostname that clients use.
4. Forward `/uplink/v1` to the backend. Enable WebSocket upgrade on the proxy.

The public port defaults to `443` unless you override it.

Example route:

```
:443 /uplink/v1  →  127.0.0.1:51822
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://learn.netmaker.io/features/gateways/tcp-uplink.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
