Skip to content

Commit d23cc3c

Browse files
committed
Add devcontainer-bridge (dbr) for VS Code-independent port forwarding
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.
1 parent d2ba55e commit d23cc3c

3 files changed

Lines changed: 24 additions & 3 deletions

File tree

.devcontainer/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CodeForge Devcontainer Changelog
22

3+
## [Unreleased]
4+
5+
### Added
6+
7+
- **devcontainer-bridge (dbr)** — Dynamic port auto-discovery and forwarding independent of VS Code. Container daemon polls for new listeners and forwards them to the host via reverse TCP connections. Requires `dbr host-daemon` running on the host machine. See [devcontainer-bridge](https://github.com/bradleybeddoes/devcontainer-bridge)
8+
39
## [v1.14.2] - 2026-02-24
410

511
### Fixed

.devcontainer/CLAUDE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Config files deploy via `file-manifest.json` on every container start. Most depl
4545
| `agent-browser` | Headless Chromium (Playwright-based) |
4646
| `check-setup` | Verify CodeForge setup health |
4747
| `claude-dashboard` | Session analytics dashboard (port 7847) |
48+
| `dbr` | Dynamic port forwarding (devcontainer-bridge) |
4849
| `cc-tools` | List all installed tools with versions |
4950

5051
## Plugins
@@ -95,3 +96,14 @@ All experimental feature flags are in `settings.json` under `env`. Setup steps c
9596
## Features
9697

9798
Custom features in `./features/` follow the [devcontainer feature spec](https://containers.dev/implementors/features/). Every local feature supports `"version": "none"` to skip installation. Claude Code is installed via `ghcr.io/anthropics/devcontainer-features/claude-code:1`.
99+
100+
## Port Forwarding
101+
102+
Two mechanisms handle port access:
103+
104+
| Mechanism | When Active | Dynamic Discovery |
105+
|-----------|-------------|-------------------|
106+
| `forwardPorts` (devcontainer.json) | VS Code / Codespaces only | Yes (VS Code auto-detect) |
107+
| devcontainer-bridge (`dbr`) | Any terminal client | Yes (polls `/proc/net/tcp`) |
108+
109+
`forwardPorts` is a no-op outside VS Code — the `devcontainer` CLI ignores it. `dbr` provides VS Code-independent dynamic port discovery via a reverse connection model (container→host). The container daemon auto-starts and is inert without the host daemon (`dbr host-daemon`). Both mechanisms coexist. See [devcontainer-bridge](https://github.com/bradleybeddoes/devcontainer-bridge).

.devcontainer/devcontainer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
// npm-dependent features (agent-browser, ccusage, ccburn, claude-session-dashboard,
3636
// biome, lsp-servers) must come after Node. uv-dependent features (ruff, claude-monitor) must
3737
// come after uv. cargo-dependent features (ccms) must come after Rust.
38-
// notify-hook is last (lightweight, no dependencies).
38+
// notify-hook is second-to-last (lightweight, no dependencies).
39+
// dbr (devcontainer-bridge) is last — standalone binary, no dependencies.
3940
"overrideFeatureInstallOrder": [
4041
"ghcr.io/devcontainers/features/node",
4142
"ghcr.io/devcontainers/features/github-cli",
@@ -63,7 +64,8 @@
6364
"./features/shellcheck",
6465
"./features/hadolint",
6566
"./features/biome",
66-
"./features/notify-hook"
67+
"./features/notify-hook",
68+
"ghcr.io/bradleybeddoes/devcontainer-bridge/dbr"
6769
],
6870

6971
"features": {
@@ -133,7 +135,8 @@
133135
"./features/notify-hook": {
134136
"enableBell": true,
135137
"enableOsc": true
136-
}
138+
},
139+
"ghcr.io/bradleybeddoes/devcontainer-bridge/dbr:latest": {}
137140
},
138141

139142
"forwardPorts": [7847],

0 commit comments

Comments
 (0)