mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6398] [MERGED] feat(outbounds): support custom subscription user agents #6253
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#6253
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/6398
Author: @T3RR7
Created: 9/3/2026
Status: ✅ Merged
Merged: 9/11/2026
Merged by: @MHSanaei
Base:
main← Head:main📝 Commits (2)
56a0967feat(outbounds): support custom subscription user agentsb13e2a9chore(merge): sync upstream main📊 Changes
22 files changed (+135 additions, -10 deletions)
View changed files
📝
docs/public/openapi.json(+14 -0)📝
frontend/public/openapi.json(+14 -0)📝
frontend/src/pages/api-docs/endpoints.ts(+15 -0)📝
frontend/src/pages/xray/outbounds/OutboundsTab.tsx(+21 -1)📝
internal/database/db.go(+11 -0)📝
internal/database/model/model.go(+1 -0)📝
internal/web/controller/xray_setting.go(+6 -3)📝
internal/web/service/outbound_subscription.go(+11 -3)📝
internal/web/service/outbound_subscription_test.go(+28 -2)📝
internal/web/translation/ar-EG.json(+1 -0)📝
internal/web/translation/en-US.json(+1 -0)📝
internal/web/translation/es-ES.json(+1 -0)📝
internal/web/translation/fa-IR.json(+1 -0)📝
internal/web/translation/id-ID.json(+1 -0)📝
internal/web/translation/ja-JP.json(+1 -0)📝
internal/web/translation/pt-BR.json(+1 -0)📝
internal/web/translation/ru-RU.json(+1 -0)📝
internal/web/translation/tr-TR.json(+2 -1)📝
internal/web/translation/uk-UA.json(+1 -0)📝
internal/web/translation/vi-VN.json(+1 -0)...and 2 more files
📄 Description
Some subscription providers require a client-specific User-Agent before returning outbound links. Persist an optional value per subscription and use it for refreshes and previews while preserving the existing default for blank values.
Summary
Add an optional custom
User-Agentsetting to outbound subscriptions. The configured value is used for both previews and scheduled/manual refreshes.Why
Some subscription providers return different content or reject requests unless they receive a supported client-specific
User-Agent.Existing subscriptions remain unchanged: when the field is empty, requests continue using
3x-ui-outbound-sub/1.0.Type of change
Areas affected
How was this tested?
TestOutboundSubscriptionRefreshUsesCustomUserAgent, which refreshes a subscription from anhttptestserver and verifies the exact receivedUser-Agent.go test ./internal/web/controller ./internal/web/service ./internal/database.npm run lint.npm run typecheck.npm run test -- --run: 127 test files and 1224 tests passed.npm run build.make format-check.make gen-check.Screenshots / recordings
N/A.
Breaking changes
None. The new database column is added automatically, and blank values retain the existing default
User-Agent.Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.