TCP & SSH Tunneling Core

Forward any TCP protocol — SSH, databases, RDP, custom protocols — through a secure gRPC tunnel. Access remote machines via native SSH, or from your browser with nfltr terminal, which the agent serves itself.

Tutorials: SSH to a machine behind NAT · Reach a private LAN · Diagnose connection problems


How TCP Tunneling Works

TCP tunneling wraps raw TCP connections inside NFLTR's encrypted gRPC transport. The agent listens on a local TCP port (e.g., SSH port 22) and relays all traffic through the tunnel. From the remote side, you use nfltr tcp-connect to establish a local listener that forwards to the remote service.

REMOTE MACHINE nfltr agent (tcp 22) SSH daemon (sshd) PostgreSQL (:5432) NFLTR SERVER Encrypted gRPC Tunnel TCP Stream Multiplexing YOUR LAPTOP ssh user@remote Browser terminal psql -h localhost

SSH Tunneling — Three Ways

⚠️ Prerequisite

SSH tunneling requires the target machine to have an SSH server (e.g. sshd) running on the configured port (typically 22). The NFLTR agent proxies SSH traffic — it does not provide SSH itself.

1. Native SSH Proxy

Use NFLTR as an SSH ProxyCommand. This integrates seamlessly with your existing SSH configuration — agent forwarding, keys, configs all work normally:

# On the remote machine
nfltr tcp 22 --name raspberry-pi --e2ee=false   # SSH encrypts end to end itself

# On your laptop — connect via native SSH
ssh -o ProxyCommand="nfltr ssh-proxy --peer %h" pi@raspberry-pi

2. Browser Terminal

Run nfltr terminal on the remote machine. The agent serves an xterm.js terminal itself, through the relay's HTTP tunnel or a share — no SSH client needed. (The relay's dashboard SSH terminal was removed.)

3. Port Forwarding

Forward any remote TCP port to a local port on your machine:

# On the remote server
nfltr tcp 5432 --name db-server

# On your laptop — PostgreSQL appears on localhost:5432
nfltr tcp-connect db-server 5432 --pin <fingerprint> --listen :5432
psql -h localhost -p 5432 -U myuser mydb

Supported Protocols

ProtocolRemote CommandLocal Access
SSHnfltr tcp 22 --name myhost --e2ee=falsessh -o ProxyCommand="nfltr ssh-proxy --peer %h" user@myhost
PostgreSQLnfltr tcp 5432 --name dbnfltr tcp-connect db 5432 --pin <fingerprint> --listen :5432
MySQLnfltr tcp 3306 --name mysqlnfltr tcp-connect mysql 3306 --pin <fingerprint> --listen :3306
Redisnfltr tcp 6379 --name redisnfltr tcp-connect redis 6379 --pin <fingerprint> --listen :6379
RDPnfltr tcp 3389 --name desktopnfltr tcp-connect desktop 3389 --pin <fingerprint> --listen :3389
Kubernetes APInfltr tcp 6443 --name k8snfltr tcp-connect k8s 6443 --pin <fingerprint> --listen :6443
Any TCPnfltr tcp <port> --name svcnfltr tcp-connect svc <port> --pin <fingerprint>
Need Windows Remote Desktop?

RDP Remote Access walks through exposing a Windows host with nfltr tcp 3389 and connecting from Microsoft Remote Desktop, Remmina, or FreeRDP.

SSH Config Integration

Add NFLTR as a permanent SSH proxy for specific hosts in ~/.ssh/config:

# ~/.ssh/config
Host raspberry-pi
    HostName raspberry-pi
    User pi
    ProxyCommand nfltr ssh-proxy --peer %h

Host office-server
    HostName office-server
    User admin
    ProxyCommand nfltr ssh-proxy --peer %h

Now ssh raspberry-pi works from anywhere — no VPN, no port forwarding.

End-to-End Encryption (E2EE)

E2EE is enabled by default on all TCP tunnels. The agent terminates TLS locally using a self-signed certificate, so the NFLTR server only relays opaque ciphertext — it never sees your plaintext traffic.

CLIENT TLS handshake with agent NFLTR SERVER Relays opaque ciphertext — zero plaintext visibility AGENT Terminates TLS, forwards plaintext

Default Behaviour (Zero Config)

Just run nfltr tcp — E2EE is on with a self-signed certificate. The agent prints its fingerprint; clients pin it with --pin. A session without a pin is refused (exit 4, ERROR_REASON_E2EE_REQUIRED): without one the relay could read it. Take the fingerprint from the agent's own output, never from the relay.

# Agent side — E2EE enabled automatically; note the fingerprint it prints
nfltr tcp 5432 --name my-db

# Client side — pin the agent's fingerprint
nfltr tcp-connect my-db 5432 --pin <fingerprint> --listen :5432
psql -h localhost -p 5432 -U myuser mydb

Bring Your Own Certificate

Supply your own TLS certificate for E2EE termination:

nfltr tcp 5432 --name my-db \
  --e2ee-cert /path/to/cert.pem \
  --e2ee-key /path/to/key.pem

Auto Let's Encrypt via ACME

Obtain a valid certificate automatically from Let's Encrypt:

nfltr tcp 5432 --name my-db \
  --acme-domain db.example.com

Disabling E2EE

If your protocol already handles its own encryption (e.g., SSH), you can disable the extra TLS layer; the agent then serves sessions without a pin, which the relay can read:

nfltr tcp 22 --name my-ssh --e2ee=false

Security

💡 SCP & SFTP work too

Since NFLTR acts as a transparent TCP proxy, scp and sftp work with the same ProxyCommand. The dashboard also generates ready-to-use SCP commands for each connected agent.

Ready to tunnel TCP?

Forward SSH, databases, or any TCP protocol in seconds.

Install the CLI Dashboard →