GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(desktop): preview tunnel listeners check the connection owner on macOS by juliusmarminge · Pull Request #41988 · pingdotgg/t3code

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Nov 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

The loopback tunnel's SOCKS listener and its forwarded ports serve only connections the system attributes to the current OS user. Linux reads that from /proc/net/tcp; macOS had no lookup. This adds one:

  • macOS: /usr/sbin/lsof -nP -iTCP@<client> -F un, matching the client's socket and comparing its uid.

On Linux and macOS a connection whose owner cannot be read is refused. On Linux that now also holds when the app has no user id to compare against. Windows is unchanged: its listeners do not check the owner. docs/internals/05_remote.md states the rule as it now is.

Cost

On macOS each tunnelled connection waits for the lookup, about 15 ms per connection measured on a Mac.

Testing

  • New cases in LoopbackTunnel.test.ts stand in for lsof and check that on macOS a client is served only when it is listed as this user's, and that on Windows a client is served with no lookup run. A new Linux case covers a missing row with no user id. The macOS and Linux cases fail without the change.
  • macOS: vp test run src/preview/LoopbackTunnel.test.ts in apps/desktop passed on a Mac, where the existing tests use the real lsof, and its output matched what the parser expects.
  • Linux: the test file passes and vp run check:changed passes. The final revision of this branch was not re-run on macOS or Windows.
  • The existing test for a forward's connection limit now handles the reset of the connection it expects to be closed, which made the test command exit non-zero on macOS with all tests passing.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Nov 24, 2026
@juliusmarminge @claude
fix(desktop): preview tunnel listeners check the connection owner on …
987823d
…macOS

The loopback tunnel's SOCKS listener and forwarded ports serve only
connections the system attributes to the current OS user. Linux reads
that from /proc/net/tcp; macOS now reads it from lsof. A connection
whose owner cannot be read is refused on both. Windows is unchanged
and has no owner check.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@juliusmarminge
juliusmarminge force-pushed the t3code/tunnel-owner-lookup branch from c5dc326 to 987823d Compare November 24, 2026 07:41
@juliusmarminge juliusmarminge changed the title fix(desktop): preview tunnel listeners check the connection owner on macOS and Windows fix(desktop): preview tunnel listeners check the connection owner on macOS Nov 24, 2026
@juliusmarminge
juliusmarminge marked this pull request as ready for review November 24, 2026 07:41
@juliusmarminge
juliusmarminge merged commit 596a237 into main Nov 24, 2026
41 of 42 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
juliusmarminge deleted the t3code/tunnel-owner-lookup branch November 24, 2026 07:42
@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Nov 24, 2026
@patroza patroza mentioned this pull request Nov 24, 2026
Merge upstream main through 2fe7febc8d73 patroza/t3code#671
Merged
@Fryuni Fryuni mentioned this pull request Nov 26, 2026
chore: sync with upstream/main (cc61cdb1e) Fryuni/t3code#98
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@juliusmarminge
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.