mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6070] [CLOSED] fix(mtproto): attribute access logs to clients #6069
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#6069
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/6070
Author: @EgorRU
Created: 7/22/2026
Status: ❌ Closed
Base:
main← Head:agent/fix-mtproto-client-logging📝 Commits (4)
05872cdfix(mtproto): attribute access logs to clients6e7fa07Merge branch 'main' into agent/fix-mtproto-client-logging6b6fd1aMerge branch 'main' into agent/fix-mtproto-client-logging68ece73Merge branch 'main' into agent/fix-mtproto-client-logging📊 Changes
8 files changed (+290 additions, -21 deletions)
View changed files
➕
internal/mtproto/access_log.go(+59 -0)➕
internal/mtproto/access_log_test.go(+45 -0)📝
internal/mtproto/manager.go(+111 -19)📝
internal/mtproto/manager_mutation_test.go(+10 -0)📝
internal/mtproto/manager_test.go(+4 -1)📝
internal/web/job/mtproto_job.go(+11 -1)📝
internal/web/service/access_log_parse_test.go(+23 -0)📝
internal/web/service/server.go(+27 -0)📄 Description
Summary
mtg-multimanagement stats responsefrom IP:port accepted tcp:target [inbound >> outbound] email: clientWhy
When an MTProto inbound routes Telegram traffic through Xray, Xray sees only the local SOCKS bridge. The access log therefore reports
tcp:127.0.0.1:<port>with an empty email, making every client in a multi-client inbound indistinguishable.The sidecar already authenticates the FakeTLS secret before dialing Telegram. Consuming its bounded access events lets the panel show the actual client socket and email while retaining the selected inbound, outbound, and Telegram target.
Type of change
Areas affected
How was this tested?
go test ./...go build ./...go test ./internal/mtproto ./internal/web/service -run 'TestAppendAccessLog|TestScrapeStats|TestParseAccessLogFields|TestIsMtprotoBridgeLog'mtg-multichange/panel/api/server/xraylogs/1000returnedFromAddress: [::1]:50284,ToAddress: tcp:[2a0a:...]:443, and the client emailfrom tcp:...formatBreaking changes
None. The stats response change is additive. A release containing MHSanaei/mtg-multi#2 is required before attributed events are available; older sidecars continue to run but do not emit them.
Checklist
go build ./...and the test suite pass locally.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.