Skip to content

feat: add ALLOW_PRIVATE_PROXY_HOSTS config for local proxy testing#88

Merged
dwgx merged 3 commits intodwgx:masterfrom
smeinecke:feat/allow-private-proxies
Apr 29, 2026
Merged

feat: add ALLOW_PRIVATE_PROXY_HOSTS config for local proxy testing#88
dwgx merged 3 commits intodwgx:masterfrom
smeinecke:feat/allow-private-proxies

Conversation

@smeinecke
Copy link
Copy Markdown
Contributor

@smeinecke smeinecke commented Apr 28, 2026

改了什么 / What changed

Add opt-in flag to allow private/internal hosts (192.168.x.x, 10.x.x.x, localhost) in dashboard proxy tests. Default remains public-only for security. When enabled, testProxy() uses validateHostFormat() instead of assertPublicUrlHost() - still validates DNS/IP format but skips SSRF guards.

New validateHostFormat() helper in net-safety.js mirrors resolvePublicAddresses() structure without private-range rejection. Config wired through .env.example, setup.sh, and config

测试 / Testing

tested locally in dashboard

Checklist

  • 代码风格和现有文件一致 / Code style matches existing files
  • 没有引入 npm 依赖 / No new npm dependencies (project is zero-dep)
  • 涉及 LS binary 协议改动时 在 PR 描述里注明字段号来源 / If touching LS protocol, document field-number source in the PR description
  • 涉及 dashboard UI 用 App.confirm / App.prompt 不用浏览器原生 alert/confirm / Uses App.confirm / App.prompt, not native dialogs (if dashboard)

Add opt-in flag to allow private/internal hosts (192.168.x.x, 10.x.x.x, localhost) in dashboard proxy tests. Default remains public-only for security. When enabled, testProxy() uses validateHostFormat() instead of assertPublicUrlHost() — still validates DNS/IP format but skips SSRF guards.

New validateHostFormat() helper in net-safety.js mirrors resolvePublicAddresses() structure without private-range rejection. Config wired through .env.example, setup.sh, and config
…rsing

Extract proxy URL parsing logic into standalone parseProxyUrl() function and export it. Reuse in buildBatchProxyBinding() and windsurfLoginBatch() instead of duplicating regex. Both call sites now use parseProxyUrl(proxy) instead of inline match + object construction.
Document new config flag in both EN/CN READMEs. Explains opt-in for private/internal IPs in proxy tests, default remains public-only.
@dwgx dwgx merged commit 543d996 into dwgx:master Apr 29, 2026
2 of 4 checks passed
dwgx added a commit that referenced this pull request Apr 29, 2026
- check-i18n.js: bare identifier 不再误报缺失 key (errKey/errCode/etc)
- 补 action.revealKey 翻译(v2.0.26 之前就缺,hardcoded fallback 已去)
- 新增 footer.langToggleTo{En,Zh} 给 PR #89 引入的 toggleBtn.title 用,去掉硬编码 '切换到中文'
- 全部 i18n 检查 + 311/311 tests pass
@smeinecke smeinecke deleted the feat/allow-private-proxies branch April 29, 2026 09:11
dwgx added a commit that referenced this pull request Apr 29, 2026
Thanks @smeinecke for the rebase — duplicate config / setup / docs from #88 are cleaned up nicely. Merging.

I noticed the proxy validation ordering inside `addAccount` (account is still created before `body.proxy` is parsed/validated) wasn't moved in this revision — I'll fix that in a follow-up commit on master right after this merges, since you've already done the heavy lifting on the feature itself. No further action needed from you. Will also add the `test/account-add-proxy.test.js` suite there.

Appreciated 🙏
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.

2 participants