Skip to content

Add raw TCP serve mode - #2

Merged
MattDHill merged 1 commit into
masterfrom
raw-tcp-serve
Jun 30, 2026
Merged

Add raw TCP serve mode#2
MattDHill merged 1 commit into
masterfrom
raw-tcp-serve

Conversation

@helix-nine

Copy link
Copy Markdown

Adds a fourth serve mode — TCP — so non-web StartOS services (LND, electrs, Bitcoin P2P, …) can be exposed over the tailnet. Previously only interfaces advertising HTTP(S) could be served, which is the gap raised in #1.

How it works

  • The Serve On Tailscale form now resolves the target interface: HTTP(S) interfaces offer HTTPS / HTTP / Funnel / TCP (default HTTPS); a non-web interface offers TCP alone (default TCP).
  • TCP routes apply tailscale serve --tcp=<port> tcp://localhost:<localPort>, reusing the existing per-serve socat forwarder unchanged (it is already raw TCP).
  • The served endpoint is exported back onto the source service's URL list as <magicdns>:<port> (no scheme prefix), with the same Stop Tailscale Serve remove button.
  • Funnel is not offered for TCP — Tailscale does not Funnel raw TCP.

Scope / notes

  • i18n (es_ES/de_DE/pl_PL/fr_FR), README, instructions, TODO, and release notes updated. Bumps to v1.96.5:1 (no migration — additive enum value).
  • Builds, typechecks, and packs. The signed-in serve --tcp apply needs a real Tailscale account to exercise end-to-end, same constraint as the existing HTTP serve path.

Refs #1.

🤖 Generated with Claude Code

Adds a fourth serve mode, TCP, so non-web services (LND, electrs, Bitcoin
P2P, ...) can be exposed over the tailnet — previously only interfaces that
advertise HTTP(S) could be served.

- serveConfig.ts: `tcp` joins the mode enum; serveModeLabel renders "TCP".
- addExposureFromUrl.ts: the "Serve On Tailscale" form resolves the target
  interface and adapts — HTTP(S) interfaces still offer HTTPS/HTTP/Funnel/TCP
  (default HTTPS), while a non-web interface offers TCP alone (default TCP).
  The handler exempts TCP from the HTTP-advertisement check.
- main.ts: TCP routes apply `tailscale serve --tcp=<port>
  tcp://localhost:<localPort>`, reusing the existing per-serve socat forwarder
  unchanged (it is already raw TCP).
- utils.ts/sync.ts: buildTailnetUrl/exportPort handle TCP; the url-v0 export
  renders the served endpoint as `<magicdns>:<port>` (no scheme prefix), with
  the same Stop-Serve remove button. Funnel is not offered for TCP — Tailscale
  does not Funnel raw TCP.
- i18n (es_ES/de_DE/pl_PL/fr_FR), README, instructions, TODO, and release
  notes updated.

Builds, typechecks, and packs (v1.96.5:1). The signed-in `serve --tcp` apply
needs a real Tailscale account to exercise, same as the HTTP serve path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@MattDHill
MattDHill merged commit b9b5761 into master Jun 30, 2026
3 checks passed
@helix-nine

Copy link
Copy Markdown
Author

Thanks for the review and merge, @MattDHill 🙏

@MattDHill
MattDHill deleted the raw-tcp-serve branch July 25, 2026 16:33
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