mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #5273] [CLOSED] feat(node): add per-node SOCKS/HTTP proxy support #5839
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5839
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/5273
Author: @NikanZeyaei
Created: 6/13/2026
Status: ❌ Closed
Base:
main← Head:feature/per-node-proxy📝 Commits (5)
9b8501cfeat(node): add proxy_url field and service support603fbc8feat(runtime): add per-node proxy support to Remoted9388abfeat(ui): add proxy URL form field and indicatorbe14404i18n(ui): add proxy-related translation keys7d600eai18n(ui): mention proxy auth in placeholder📊 Changes
20 files changed (+271 additions, -30 deletions)
View changed files
📝
frontend/src/pages/nodes/NodeFormModal.tsx(+11 -0)📝
frontend/src/pages/nodes/NodeList.tsx(+16 -0)📝
frontend/src/schemas/node.ts(+2 -0)📝
internal/database/model/model.go(+1 -0)📝
internal/web/runtime/remote.go(+59 -1)📝
internal/web/service/node.go(+84 -29)📝
internal/web/service/node_test.go(+46 -0)📝
internal/web/translation/ar-EG.json(+4 -0)📝
internal/web/translation/en-US.json(+4 -0)📝
internal/web/translation/es-ES.json(+4 -0)📝
internal/web/translation/fa-IR.json(+4 -0)📝
internal/web/translation/id-ID.json(+4 -0)📝
internal/web/translation/ja-JP.json(+4 -0)📝
internal/web/translation/pt-BR.json(+4 -0)📝
internal/web/translation/ru-RU.json(+4 -0)📝
internal/web/translation/tr-TR.json(+4 -0)📝
internal/web/translation/uk-UA.json(+4 -0)📝
internal/web/translation/vi-VN.json(+4 -0)📝
internal/web/translation/zh-CN.json(+4 -0)📝
internal/web/translation/zh-TW.json(+4 -0)📄 Description
Summary
Closes #5256
Adds an optional per-node proxy URL so the central panel can route outbound API calls to a remote node through a SOCKS5 (
socks5/socks5h) or HTTP/HTTPS proxy. This helps users in restricted network environments reach nodes that are not directly accessible.Why
Users in regions with restricted connectivity may have nodes outside the country that are hard to reach directly. A panel-wide proxy is not always desirable; per-node proxy allows routing only the necessary node traffic through a local or remote proxy. Credentials can be embedded in the URL (
socks5://user:pass@host:port).Type of change
Areas affected
How was this tested?
go build ./...— passes.go test ./internal/web/service/... ./internal/web/runtime/...— passes.cd frontend && npm run typecheck— passes.cd frontend && npm run test— passes.cd frontend && npm run build— passes.http://user:pass@host:port).socks5://user:pass@host:port).Implementation details
Backend (Go):
ProxyUrlfield to theNodemodel (internal/database/model/model.go); GORM auto-migration adds theproxy_urlcolumn.NodeService.normalize()and persistence inUpdate()(internal/web/service/node.go).nodeHTTPClientFor()to build proxy-aware clients vianetproxy.NewHTTPClient()while preserving the shared global client for the no-proxy default case.FetchCertFingerprint()to route certificate fingerprint fetching through the proxy when configured.Remoteininternal/web/runtime/remote.goto build a per-node HTTP client honoring the proxy URL and TLS skip/pin settings.internal/web/service/node_test.go).Frontend (TypeScript/React):
proxyUrltoNodeRecordSchemaandNodeFormSchema(frontend/src/schemas/node.ts).NodeFormModal.tsxwith placeholder and hint.NodeList.tsxtable and mobile card views.Translations:
proxyUrl,proxyUrlPlaceholder,proxyUrlHint, andproxyTooltipkeys to all 13 supported language files.Files changed
internal/database/model/model.gointernal/web/service/node.gointernal/web/service/node_test.gointernal/web/runtime/remote.gofrontend/src/schemas/node.tsfrontend/src/pages/nodes/NodeFormModal.tsxfrontend/src/pages/nodes/NodeList.tsxinternal/web/translation/en-US.jsoninternal/web/translation/ar-EG.jsoninternal/web/translation/es-ES.jsoninternal/web/translation/fa-IR.jsoninternal/web/translation/id-ID.jsoninternal/web/translation/ja-JP.jsoninternal/web/translation/pt-BR.jsoninternal/web/translation/ru-RU.jsoninternal/web/translation/tr-TR.jsoninternal/web/translation/uk-UA.jsoninternal/web/translation/vi-VN.jsoninternal/web/translation/zh-CN.jsoninternal/web/translation/zh-TW.jsonScreenshots / recordings
Breaking changes
None.
Checklist
go build ./...and the test suite pass locally.npm run typecheckandnpm run buildpass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.