Skip to content

Add devcontainer-bridge (dbr) for dynamic port forwarding#13

Merged
AnExiledDev merged 2 commits intomainfrom
worktree-add-dbr-feature
Feb 26, 2026
Merged

Add devcontainer-bridge (dbr) for dynamic port forwarding#13
AnExiledDev merged 2 commits intomainfrom
worktree-add-dbr-feature

Conversation

@AnExiledDev
Copy link
Owner

@AnExiledDev AnExiledDev commented Feb 25, 2026

Summary

  • Adds devcontainer-bridge (dbr) as an external devcontainer feature
  • Provides dynamic port auto-discovery independent of VS Code (polls /proc/net/tcp, reverse TCP forwarding to host)
  • Container daemon is inert without host-side dbr host-daemon — VS Code users unaffected
  • forwardPorts retained for VS Code notify UX; both mechanisms coexist

Changes

  • devcontainer.json — added ghcr.io/bradleybeddoes/devcontainer-bridge/dbr:latest to features and install order
  • CHANGELOG.md — added [Unreleased] entry
  • CLAUDE.md — added dbr command and Port Forwarding section

Test plan

  • Rebuild container — verify which dbr returns a path
  • dbr container-daemon --help works inside container
  • Without host daemon: container daemon backs off silently, no errors
  • With host daemon on host: ports auto-discovered and forwarded
  • VS Code forwardPorts still works as before

Summary by CodeRabbit

  • New Features

    • Introduced devcontainer-bridge (dbr) for dynamic port discovery and forwarding outside VS Code.
    • Added a new dbr command for host-aware port forwarding.
  • Documentation

    • Expanded port forwarding docs with activation contexts, dynamic discovery behavior, and coexistence guidance.
    • Noted host-daemon requirement and added changelog Unreleased entry.

@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d23cc3c and be87c2d.

📒 Files selected for processing (3)
  • .devcontainer/CHANGELOG.md
  • .devcontainer/CLAUDE.md
  • .devcontainer/devcontainer.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • .devcontainer/CLAUDE.md
  • .devcontainer/CHANGELOG.md
  • .devcontainer/devcontainer.json

📝 Walkthrough

Walkthrough

Adds devcontainer-bridge (dbr) support: an Unreleased changelog entry announcing dynamic in-container port discovery and forwarding (requires a host-daemon), documents the dbr command and port-forwarding mechanisms in CLAUDE.md, and registers ghcr.io/bradleybeddoes/devcontainer-bridge/dbr:0.2.0 in devcontainer.json with updated feature install order.

Changes

Cohort / File(s) Summary
Documentation Changes
.devcontainer/CHANGELOG.md, .devcontainer/CLAUDE.md
Added Unreleased changelog entry for devcontainer-bridge; added dbr command and a new Port Forwarding section describing forwardPorts (VS Code-only) and devcontainer-bridge (dbr) (dynamic discovery, requires host-daemon, works outside VS Code).
Devcontainer Configuration
.devcontainer/devcontainer.json
Added feature ghcr.io/bradleybeddoes/devcontainer-bridge/dbr:0.2.0; updated overrideFeatureInstallOrder to place ./features/notify-hook before the new dbr entry and set dbr as the final standalone binary.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Container
participant dbr as devcontainer-bridge (in container)
participant HostDaemon as Host Daemon (dbr host-daemon)
participant Client as Host Client (e.g., VS Code / terminal)
Container->>dbr: Open port/service
dbr->>HostDaemon: Reverse-connect and announce forwarded port
HostDaemon->>Client: Expose/forward port to host (and clients)
Client->>HostDaemon: Connect to forwarded port
HostDaemon->>dbr: Route traffic back to Container
dbr->>Container: Deliver traffic to service

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I found a tunnel in the code tonight,
Ports wiggled free and hopped into light,
A host-daemon handshake, a bridge so spry,
I tunneled through bytes and gave a happy cry! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding devcontainer-bridge (dbr) for dynamic port forwarding functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch worktree-add-dbr-feature

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.devcontainer/CHANGELOG.md:
- Around line 5-7: Under the "### Added" section add a `####` sub-heading (e.g.,
"#### Features") and replace the implementation-focused bullet about
"devcontainer-bridge (dbr)" with a user-facing description: keep the identifier
"devcontainer-bridge (dbr)" and the requirement "requires `dbr host-daemon`
running on the host machine" but reword the rest to state the user-visible
change (what it enables for users, e.g., automatic discovery and forwarding of
container ports to the host) instead of describing the internal
polling/reverse-TCP mechanism.

In @.devcontainer/CLAUDE.md:
- Around line 104-107: The "Dynamic Discovery" column incorrectly marks
`forwardPorts` (in `devcontainer.json`) as "Yes"; update the table so
`forwardPorts` is shown as static (e.g., "No" or "Static declaration") and add a
brief parenthetical or footnote clarifying that VS Code's separate auto
port-forwarding feature performs runtime discovery of listeners (this is
distinct from the `forwardPorts` static setting), while `devcontainer-bridge`
(`dbr`) remains the dynamic mechanism that polls `/proc/net/tcp`.

In @.devcontainer/devcontainer.json:
- Line 139: Replace the unpinned image reference
"ghcr.io/bradleybeddoes/devcontainer-bridge/dbr:latest" with a specific,
immutable version tag (e.g., match the semver style used for other images like
"node:1.7.1" or pick the latest known stable dbr release) so the devcontainer
becomes reproducible; update the string in the devcontainer features list to use
"ghcr.io/bradleybeddoes/devcontainer-bridge/dbr:<version>" and ensure the chosen
version is committed in the file (not ":latest").

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d2ba55e and d23cc3c.

📒 Files selected for processing (3)
  • .devcontainer/CHANGELOG.md
  • .devcontainer/CLAUDE.md
  • .devcontainer/devcontainer.json

forwardPorts in devcontainer.json is a no-op outside VS Code. dbr provides
dynamic port auto-discovery via /proc/net/tcp polling and forwards to the
host via reverse TCP connections. Container daemon is inert without the
host daemon, so VS Code users are unaffected.
- CHANGELOG: add #### Features sub-heading, rewrite bullet as user-facing
- CLAUDE.md: forwardPorts is static, not dynamic discovery
- CLAUDE.md: fix Claude Code version ref (:1 → :1.0.5)
- devcontainer.json: pin dbr to 0.2.0 instead of :latest
@AnExiledDev AnExiledDev force-pushed the worktree-add-dbr-feature branch from be87c2d to 5b3a9c0 Compare February 26, 2026 03:04
@AnExiledDev AnExiledDev merged commit b7f8bf5 into main Feb 26, 2026
@AnExiledDev AnExiledDev deleted the worktree-add-dbr-feature branch February 26, 2026 03:04
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.

1 participant