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:
authorMHSanaei <ho3ein.sanaei@gmail.com>2026-01-09 22:22:33 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2026-01-09 22:22:33 +0300
commite42c17f2b272c6236af55b948f37c38a66f82e70 (patch)
tree53a391d28c62d2a00fea16b8a147b032d4f17594 /database/model/model.go
parent427b7b67d8c67c75f7a98c84a24145118033ebd8 (diff)
Default listen address to 0.0.0.0 in GenXrayInboundConfig
When the listen address is empty, it now defaults to 0.0.0.0 to ensure proper dual-stack IPv4/IPv6 binding, improving compatibility on systems with bindv6only=0.
Diffstat (limited to 'database/model/model.go')
-rw-r--r--database/model/model.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/database/model/model.go b/database/model/model.go
index 4ca39d87..6225df52 100644
--- a/database/model/model.go
+++ b/database/model/model.go
@@ -80,9 +80,12 @@ type HistoryOfSeeders struct {
// GenXrayInboundConfig generates an Xray inbound configuration from the Inbound model.
func (i *Inbound) GenXrayInboundConfig() *xray.InboundConfig {
listen := i.Listen
- if listen != "" {
- listen = fmt.Sprintf("\"%v\"", listen)
+ // Default to 0.0.0.0 (all interfaces) when listen is empty
+ // This ensures proper dual-stack IPv4/IPv6 binding in systems where bindv6only=0
+ if listen == "" {
+ listen = "0.0.0.0"
}
+ listen = fmt.Sprintf("\"%v\"", listen)
return &xray.InboundConfig{
Listen: json_util.RawMessage(listen),
Port: i.Port,