mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6447] port 2096 #4366
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#4366
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 @its0ka on GitHub (Sep 10, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6447
Is your feature request related to a problem?
is port 2096 default for subs? does every install have it open?
2096 was the only low port on my vps and it got ip blocked in russia.
Describe the solution you'd like
make it random
Alternatives you've considered
No response
Concrete use case
No response
Mockups, screenshots, or examples
No response
Which parts of the panel would this affect?
No response
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Sep 10, 2026):
Short answer: yes —
2096is the default subscription port and a fresh panel does listen on it, but nothing in the installer opens it in a firewall, and you can change it yourself today in Settings.Where 2096 comes from
internal/web/service/setting.go:131—"subPort": "2096",internal/web/service/setting.go:91—"subEnable": "true",subListendefaults to empty (internal/web/service/setting.go:130) andinternal/sub/sub.gobuilds the address aslistenAddr := net.JoinHostPort(listen, strconv.Itoa(port)).So every fresh panel listens on
0.0.0.0:2096. Whether it is reachable from the internet is your firewall's call:install.shnever touchesufw. The only rule that opens it isufw allow 2096/tcp #subportininstall_firewall()(x-ui.sh:1099), and that function runs only when you pick the firewall option from thex-uimenu (x-ui.sh:1046). On a VPS with no host firewall and no cloud security group, listening does mean open. On the shipped Docker setup it is not published —docker-compose.yml:50maps only"2053:2053".Changing it now
subPortfield,frontend/src/pages/settings/SubscriptionGeneralTab.tsx:105), set your own port and save.The listener is bound only in
Server.Start()(internal/sub/sub.go), so saving alone does not rebind it.Two things worth knowing first:
BuildSubURIBasereturnsfmt.Sprintf("%s://%s:%d", scheme, subDomain, subPort)(internal/web/service/setting.go:1579) — so clients already given a link need the new one.subPortmay not collide with the panel's ip:port;internal/web/entity/entity.go:246rejects(s.SubPort == s.WebPort) && listenAddressesConflict(...).Two alternatives that remove the exposure entirely:
subEnableoff —Server.Start()returns early (internal/sub/sub.go:351,if !subEnable { return nil }) and nothing binds.subListento127.0.0.1and serve subscriptions through a reverse proxy on 443; then 2096 is not exposed at all.Reference: Subscription and Ports & Firewall.
On the request itself
Randomising it fits what the project already does elsewhere:
install.shpicks a random panel port (config_port=$(shuf -i 1024-62000 -n 1),install.sh:1203andinstall.sh:1212) and a random web base path (install.sh:1065), and a fresh database gets random subscription paths (seedRandomSubscriptionPaths,internal/database/db.go:1223-1227, threerandom.NumLower(16)values). The sub port is the one fixed default left. Implementation-wise it is not a one-liner in the installer:x-ui settinghas no-subPortflag (the flag set is defined atmain.go:606-642, where-portexists but nothing for the sub server), so it would need either a new flag or a seed next to those random paths indb.go.One thing I could not check from the repository: why your IP was blocked. Nothing in the source tells me what the block keyed on — that a constant
2096is a stable fingerprint on a default install is my inference, not something the code establishes.Related but not the same report: #4444 hit the same constant from the other side — setting the panel port to 2096 collided with the subscription server.
Verdict: Feature request
This reply was generated automatically; a maintainer may follow up.