mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5023] [Bug]: externalProxy missing from /panel/api/inbounds/list (and get) responses + updates via token have no effect #3536
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#3536
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?
Originally created by @rqzbeh on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5023
Describe the bug
When authenticating only with the 3x-UI API token (
Authorization: Bearer+X-UI-INBOUND-KEY), the inbound objects returned by/panel/api/inbounds/list(and subsequent per-id lookups) never contain theexternalProxyfield, even for inbounds that have external hosts configured through the web UI.Posting an update containing
externalProxyat the top level to/panel/api/inbounds/update/{id}returns 200, but the change is never reflected in the panel (neither in the inbound list nor when editing the inbound), even after:Environment
http://127.0.0.1:17446/8WqqarhYPjFRqQHoRd/)cf, e.g.[] NL1-CF,[] NL2-CF, etc.)How to reproduce the problem
GET /panel/api/inbounds/list(with Bearer + X-UI-INBOUND-KEY)[up total remark trafficReset tag sniffing id expiryTime clientStats enable port down lastTrafficResetTime listen protocol settings streamSettings]
There is no
externalProxykey (we also explicitly parsed thesettingsstring value looking for it — still absent).• The same token works correctly for listing inbounds and updating other fields on the same inbounds.
• The web UI itself can see and configure external hosts without problems.
• A supporting Go client (stdlib only) that produces the exact logs above is available if useful.
• Using a real session cookie (full username/password login) may behave differently — this is currently being tested by the reporter.
Expected behavior
• externalProxy (when set on an inbound) should be returned in the objects from /panel/api/inbounds/list and equivalent get paths, even under API token authentication.
• Updates containing externalProxy at the root level (same shape used by the web UI) should be persisted when the token auth path already works for listing and updating other inbound fields.
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.2.8
Xray-core version
26.6.1
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 24.04
Which parts of the panel are affected?
Backend (API endpoints, login, settings)
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
Yes — Nginx
Before submitting
@github-actions[bot] commented on GitHub (Jun 6, 2026):
Thanks for the detailed report. After tracing through the source (
database/model/model.go,web/service/inbound.go,web/controller/inbound.go) I can explain both observations.1.
externalProxyis instreamSettings, not at the top levelThe
Inboundmodel has these top-level JSON fields:externalProxyis a field insidestreamSettings, not a sibling of it. The panel stores and retrieves it as part of thestream_settingscolumn. BecauseInbound.MarshalJSON()expandsstreamSettingsfrom a stored JSON string into a real nested JSON object, the list/get response looks like:The
externalProxyarray was never insettings(the protocol-level object that holdsclients), so searching that field would always come up empty. Checkresponse.obj.streamSettings.externalProxyinstead.2. Why the update POST returns 200 but nothing changes
When you POST to
/panel/api/inbounds/update/{id}, the body is deserialized intomodel.Inbound. That struct has no top-levelexternalProxyfield, so Go's JSON decoder silently ignores any unknown keys — including a top-levelexternalProxy. The 200 response is returned after the record is saved, but the field was never read.To update external proxy entries,
externalProxymust be inside thestreamSettingsJSON object you send:The safest approach is to:
GET /panel/api/inbounds/get/{id}to fetch the complete current object (itsstreamSettingswill already containexternalProxyif one is configured).response.obj.streamSettings.externalProxyin your client.POST /panel/api/inbounds/update/{id}with the modified full object (thestreamSettingsvalue you send can be either a nested JSON object or a JSON-encoded string — both are accepted byUnmarshalJSON).Side note on the log errors
The
node traffic sync: merge for … failed: ERROR: CASE types boolean and integer cannot be matchedlines are a separate PostgreSQL-specific bug in the node traffic sync job and are unrelated toexternalProxy. If that's causing problems for you, it would be worth opening a separate issue with details about your node setup (panel + node versions, PostgreSQL version).Closing as a question since the behavior is working as designed. Feel free to reopen if after trying the above the
externalProxyfield is genuinely absent fromstreamSettingsin your API responses.@rqzbeh commented on GitHub (Jun 7, 2026):
well I think you were wrong, especially on postgreSQL version, I did commit a fix for that in:
https://github.com/MHSanaei/3x-ui/pull/5038