Skip to content

fix: support ipv6 proxy management in admin ui#2522

Open
gebdalaoli-arch wants to merge 7 commits into
Wei-Shaw:mainfrom
gebdalaoli-arch:codex/ipv6-proxy-management
Open

fix: support ipv6 proxy management in admin ui#2522
gebdalaoli-arch wants to merge 7 commits into
Wei-Shaw:mainfrom
gebdalaoli-arch:codex/ipv6-proxy-management

Conversation

@gebdalaoli-arch

Copy link
Copy Markdown

This fixes IPv6 proxy management in the Sub2API admin IP/proxy workflow.

Problem:
The admin proxy UI accepted proxy hosts as plain strings, while the backend and helper utilities treated host:port formatting as IPv4-shaped. SOCKS5 IPv6 proxies therefore could be stored or displayed inconsistently, and bracketed IPv6 URLs from imports/checks could fail to match existing proxy entries.

Root cause:
Proxy host normalization and URL formatting did not consistently distinguish the stored host from the URL authority form. IPv6 needs brackets only when combined with a port in URLs, but storage and comparisons should use the canonical bare host form.

Fix:

  • Added backend proxy host normalization and URL formatting helpers.
  • Normalized IPv6 hosts across create, update, check-exists, import/export, selector, and usage queue paths.
  • Added an admin UI IP version selector for IPv4/IPv6 while keeping the existing UI style.
  • Added frontend proxy-address helpers for bracketed IPv6 parsing, display, and copy formats.
  • Added regression tests for backend normalization/import reuse and frontend IPv6 parsing/formatting.

Verification:

  • go test ./internal/service -run "TestNormalizeProxyHost|TestProxyURL|TestProxyURLNormalizesBracketedIPv6Host"
  • go test ./internal/handler/admin -run "TestProxyHandlerCreateNormalizesIPv6Host|TestProxyImportDataReusesIPv6ProxyAcrossBracketFormats|TestProxyImportDataReusesIPv6ProxyWhenKeyOnlyUsesBracketedHost|TestImportDataReusesIPv6ProxyKeyAcrossBracketFormats"
  • pnpm install --frozen-lockfile
  • pnpm typecheck
  • pnpm build
  • Built asset spot-check for socks5://user:p%40ss%3Aword@[2001:db8::1]:1080 parsing/normalization/URL formatting

@github-actions

github-actions Bot commented May 16, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Before we can merge this PR, we need you all to sign our Contributor License Agreement (CLA).

To sign, please reply with the following comment:

I have read the CLA Document and I hereby sign the CLA

You only need to sign once — it will be valid for all your future contributions to this project.


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the CLA.
✅ (gebdalaoli-arch)[https://github.com/gebdalaoli-arch]
❌ @new_dev
new_dev seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@gebdalaoli-arch

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@gebdalaoli-arch gebdalaoli-arch force-pushed the codex/ipv6-proxy-management branch from 3507ee1 to f5adf06 Compare May 16, 2026 19:37
@gebdalaoli-arch gebdalaoli-arch force-pushed the codex/ipv6-proxy-management branch from f5adf06 to ce00273 Compare May 16, 2026 19:45
github-actions Bot added a commit that referenced this pull request May 16, 2026
@gebdalaoli-arch

Copy link
Copy Markdown
Author

recheck

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