Skip to content

tailcat: add serve --log-clients to log incoming connections - #127

Open
avionicharshit-byte wants to merge 1 commit into
tailscale:mainfrom
avionicharshit-byte:log-clients
Open

avionicharshit-byte wants to merge 1 commit into
tailscale:mainfrom
avionicharshit-byte:log-clients

Conversation

@avionicharshit-byte

Copy link
Copy Markdown
Contributor

closes #39

adds tailcat serve --log-clients. with it the server logs one line to stderr per incoming connection:

client nodekey:efa7…406a connected to tcp port 54885 (direct 127.0.0.1:58195)
  • which client (its public key), what it connected to (served port, or the tcp/udp destination for exit-node), and whether the path is direct or relayed through DERP
  • own flag rather than --verbose, per your comment that --verbose is debug spam
  • stderr only, so stdout stays clean for piped data
  • the direct/relayed part comes from Server.Status().Peer, which tailcat: report peers in Server.Status so callers can see direct vs relayed #121 made non-empty

to map a conn back to a client key i added Server.ClientForAddr, since the peer entries in Status() don't carry the client's tailcat address.

TestServeLogClients runs the server with and without the flag and checks the line shows up only with it. go test ./... passes.

Signed-off-by: avionicharshit-byte <harshitavionic@gmail.com>
@avionicharshit-byte
avionicharshit-byte marked this pull request as ready for review September 19, 2026 08:12
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.

Add verbose logging flag to log incoming connections

1 participant