Skip to content

cmd/tailcat: support forwarding to exit-node targets - #74

Closed
Audi-dask wants to merge 3 commits into
tailscale:mainfrom
Audi-dask:forward-exit-node
Closed

cmd/tailcat: support forwarding to exit-node targets#74
Audi-dask wants to merge 3 commits into
tailscale:mainfrom
Audi-dask:forward-exit-node

Conversation

@Audi-dask

@Audi-dask Audi-dask commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What does this change do?

Extend tailcat forward to expose arbitrary IP:port targets reachable through a Tailnet server running as an exit node.

This makes it possible to forward local TCP ports to assets on the exit node's network, including multiple targets in one command, without requiring SOCKS or application-specific proxy support.

Related to #14.

Examples

Start an exit-node server:

tailcat serve exit-node
# Server listening with new address: tcXXXXXXXXX

Forward local ports to two remote targets:

tailcat forward tcXXXXXXXXX \
    3001:172.23.52.30:3001 \
    17170:172.23.52.31:17170

This forwards:

127.0.0.1:3001  -> 172.23.52.30:3001
127.0.0.1:17170 -> 172.23.52.31:17170

Design

  • Keeps existing local-to-server port forwarding behavior.
  • Supports local-port to remote IP:port mappings for exit-node targets.
  • Supports multiple mappings in one tailcat forward invocation.
  • Uses the existing Client.DialTCP and ProxyConns APIs.
  • Does not change the Tailnet wire protocol.
  • Does not introduce a new dependency.

Testing

  • Added parsing coverage for IP:port exit-node targets.
  • Added an end-to-end test for forwarding to an exit-node target.
  • Preserved the existing end-to-end test for ordinary served-port forwarding.

Tested with:

go test ./cmd/tailcat -run '^TestForward(ToExitNodeTarget|EndToEnd)$' -v

Allow forward mappings to target IP:port destinations reachable through an exit-node server, with end-to-end coverage and README examples.
@bradfitz

bradfitz commented Sep 3, 2026

Copy link
Copy Markdown
Member

You need to rebase this branch and drop the first commit it seems.

@Audi-dask

Copy link
Copy Markdown
Contributor Author

Superseded by #75, which is based on the latest main and contains only the exit-node target forwarding changes.

@Audi-dask Audi-dask closed this Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants