Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Kamyshnikov <igor.kamyshnikov@gmail.com>2026-01-03 06:39:30 +0300
committerGitHub <noreply@github.com>2026-01-03 06:39:30 +0300
commitb7477302112b43a2ae037b63994c59e85f9c0687 (patch)
treef49ecce958c238b901e8c85e9f5b1f3e1baa1e58
parent692a73788aed32a6247a9bebbf3600cf665e4b0f (diff)
vless: use Inbound Listen address in Subscription service (#3610)
* vless: use Inbound Listen address in Subscription service vless manual connection link and subscription produced connection link are aligned. subscription service now returns an IP address configured on Inbound, instead of subscription service IP, which is consistent when the address, returned by QR code for manual vless link distribution.
-rw-r--r--sub/subService.go30
1 files changed, 26 insertions, 4 deletions
diff --git a/sub/subService.go b/sub/subService.go
index 55bddf7f..ade871df 100644
--- a/sub/subService.go
+++ b/sub/subService.go
@@ -179,9 +179,15 @@ func (s *SubService) genVmessLink(inbound *model.Inbound, email string) string {
if inbound.Protocol != model.VMESS {
return ""
}
+ var address string
+ if inbound.Listen == "" || inbound.Listen == "0.0.0.0" || inbound.Listen == "::" || inbound.Listen == "::0" {
+ address = s.address
+ } else {
+ address = inbound.Listen
+ }
obj := map[string]any{
"v": "2",
- "add": s.address,
+ "add": address,
"port": inbound.Port,
"type": "none",
}
@@ -317,7 +323,13 @@ func (s *SubService) genVmessLink(inbound *model.Inbound, email string) string {
}
func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string {
- address := s.address
+ var address string
+ if inbound.Listen == "" || inbound.Listen == "0.0.0.0" || inbound.Listen == "::" || inbound.Listen == "::0" {
+ address = s.address
+ } else {
+ address = inbound.Listen
+ }
+
if inbound.Protocol != model.VLESS {
return ""
}
@@ -523,7 +535,12 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string {
}
func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string {
- address := s.address
+ var address string
+ if inbound.Listen == "" || inbound.Listen == "0.0.0.0" || inbound.Listen == "::" || inbound.Listen == "::0" {
+ address = s.address
+ } else {
+ address = inbound.Listen
+ }
if inbound.Protocol != model.Trojan {
return ""
}
@@ -719,7 +736,12 @@ func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string
}
func (s *SubService) genShadowsocksLink(inbound *model.Inbound, email string) string {
- address := s.address
+ var address string
+ if inbound.Listen == "" || inbound.Listen == "0.0.0.0" || inbound.Listen == "::" || inbound.Listen == "::0" {
+ address = s.address
+ } else {
+ address = inbound.Listen
+ }
if inbound.Protocol != model.Shadowsocks {
return ""
}