Repository navigation
cmd/tailcat: serve Unix-domain sockets - #104
Merged
Merged
Conversation
bradfitz
reviewed
Sep 18, 2026
atirna
force-pushed
the
feat/serve-unix-sockets
branch
from
September 19, 2026 20:16
9f8c01b to
be4b69e
Compare
Contributor
Author
|
added: --unix-socket now takes an optional ,port suffix (port 1 stays the default), the packet filter and dispatch key on the parsed port, and the README shows the forward command for reaching a custom port. ,8022 with an empty pathname is rejected at startup. |
atirna
force-pushed
the
feat/serve-unix-sockets
branch
2 times, most recently
from
September 24, 2026 18:12
b7ac680 to
07dd1dd
Compare
A serve spec item starting with "/" or "unix:" now names a local Unix-domain stream socket to proxy connections to. Given alone, as in "tailcat serve /run/git-annex/socket", it serves every port not otherwise served, like the exec service, so clients reach it with a plain "tailcat <tc-addr>" and never need a port number. As a port mapping target, as in "8022:/run/app.sock", it serves just that port, which allows several sockets or a socket alongside other services. Items are still classified purely lexically, and the grammar is now written down in parsePortSet's doc comment: a service name, then a socket, then a "port:target" mapping split at the first colon, then a port or range. Any target starting with "unix:" is a socket. A catch-all socket can't be combined with another, or with all, exec, or exit-node, since those claim every port too. After parsing, the server checks that each socket exists (and on Unix that it is a socket) and refuses to start otherwise. tailcat doesn't create the socket or change its permissions. This is PR tailscale#104 reworked by Brad: it replaces the PR's --unix-socket flag and its ",port" suffix with socket targets in the serve spec. Fixes tailscale#93 Fixes tailscale#104 Co-authored-by: Brad Fitzpatrick <bradfitz@tailscale.com>
bradfitz
force-pushed
the
feat/serve-unix-sockets
branch
from
November 22, 2026 19:27
07dd1dd to
54017f4
Compare
Member
|
I've changed the UX of this to match some of the other modes more closely. (the comma-separated thing was kinda weird considering we already had the portspec thing) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tailcat serve --unix-socket=<path>for a local Unix-domain stream socket.Why
This lets a local Unix-socket service be reached directly without first exposing it on a TCP port.
Testing
mainhas no--unix-socketserve option.go test ./cmd/tailcat -run '^TestServeUnixSocket$' -count=1Fixes #93