mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #5503] [MERGED] fix(sockopt): honor trustedXForwardedFor on gRPC inbounds (xray v26.6.22) #5905
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#5905
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/5503
Author: @rqzbeh
Created: 6/23/2026
Status: ✅ Merged
Merged: 6/23/2026
Merged by: @MHSanaei
Base:
main← Head:feat/grpc-trusted-xff-v26.6.22📝 Commits (3)
56dc9b5fix(sockopt): honor trustedXForwardedFor on gRPC inboundsd648938Merge branch 'main' into feat/grpc-trusted-xff-v26.6.22ab6615cdocs(i18n): note gRPC in trustedXForwardedFor hint (all locales)📊 Changes
14 files changed (+19 additions, -17 deletions)
View changed files
📝
frontend/src/pages/inbounds/form/transport/sockopt.tsx(+6 -4)📝
internal/web/translation/ar-EG.json(+1 -1)📝
internal/web/translation/en-US.json(+1 -1)📝
internal/web/translation/es-ES.json(+1 -1)📝
internal/web/translation/fa-IR.json(+1 -1)📝
internal/web/translation/id-ID.json(+1 -1)📝
internal/web/translation/ja-JP.json(+1 -1)📝
internal/web/translation/pt-BR.json(+1 -1)📝
internal/web/translation/ru-RU.json(+1 -1)📝
internal/web/translation/tr-TR.json(+1 -1)📝
internal/web/translation/uk-UA.json(+1 -1)📝
internal/web/translation/vi-VN.json(+1 -1)📝
internal/web/translation/zh-CN.json(+1 -1)📝
internal/web/translation/zh-TW.json(+1 -1)📄 Description
Summary
Make gRPC inbounds honor
sockopt.trustedXForwardedForin the panel, matching xray-core v26.6.22.Why
xray-core v26.6.22 (commit 711aea4) switched the gRPC server from reading the
x-real-ipgRPC metadata to resolving the client IP fromX-Forwarded-Forviasockopt.trustedXForwardedFor— the same mechanism already used by ws / httpupgrade / xhttp.The panel already exposes the
trustedXForwardedForfield, wire-normalizes it, and renders the input. Only the per-transport gate (TRUSTED_HEADER_NETWORKSintransport/sockopt.tsx) still omittedgrpc. As a result, on a gRPC inbound the panel raised a false "this transport does not honor the header" warning and mis-flagged the Cloudflare real-client-IP preset, even though the generated config is valid and xray now honors it.No Go dependency bump is needed:
go.modalready pins an xray-core pseudo-version dated 2026-06-22, and 711aea4 landed 2026-06-18.Type of change
Areas affected
How was this tested?
go build ./...✓, full Go test suitego test -shuffle=on -count=1✓.typecheck✓,lint✓; test counts unchanged vs. base.Screenshots / recordings
N/A — removes an erroneous warning; no new UI surface.
Breaking changes
None.
Checklist
go build ./...and the test suite pass locally.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.