Repository navigation
fix: allow remote clients when bound to a non-loopback host (#240) - #241
Merged
Merged
Conversation
- setupMitm: new allowRemoteClients flag; remote CONNECT accepted only for whitelisted model hosts (blind tunnels stay loopback-only — no open relay) - server: derive the flag from --host; honest 0.0.0.0 display + [security] warning on non-loopback binds - tests: #77 case extended to the full remote policy matrix - docs: README/CONFIGURATION remote-agents section (en+zh)
Contributor
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-241Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr241.tgz
npm install -g packageThis comment is automatically updated on each push. |
Merged
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.
Model: qwen3.8-27b (vllm)
Fixes #240.
Problem
With
host: 0.0.0.0the HTTP side (/bili/prefix, health) was already reachable from remote machines, but MITM-modeCONNECThard-rejected every non-loopback client (the #77 gate insrc/mitm.ts) — so remote agents relying on proxy-mode HTTPS got 403.Change
src/mitm.ts—setupMitmgainsallowRemoteClients = false:src/server.ts— derives the flag from the bind host (0.0.0.0/::/ LAN IP ⇒ remote allowed), passes it tosetupMitm; startup log now shows the honest bind (0.0.0.0, not masquerading aslocalhost) and prints a[security]warning on non-loopback binds (no authentication;/__bili/management endpoints stay loopback-only).tests/mitm.test.ts— 绑定 0.0.0.0 时 MITM CONNECT 为无鉴权开放 TCP 转发 [master/pre-existing] #77 test rewritten as the full remote policy matrix (strict → 403; allowed + api.anthropic.com → 200; allowed + example.com → 403). Runs on the host's real LAN address, skips on boxes without one.--host)" section (also resolves the dangling "see host note below" pointer); CONFIGURATION(.zh-CN).mdhostentry extended with the remote-CONNECT policy.Verification
--host 0.0.0.0 --port 18788, client via 192.168.10.157): health 200;CONNECT api.anthropic.com→ "tunnel established (TLS terminated locally)" (curl then alerts unknown-ca client-side, as expected without the root CA);CONNECT example.com→ rejected with "remote client … tunneling non-whitelisted host"