Files
trihuy-russian/xray/inbound.go
T

46 lines
1.2 KiB
Go
Raw Normal View History

2023-02-09 22:48:06 +03:30
package xray
import (
"bytes"
2024-03-11 01:01:24 +03:30
2025-09-19 10:05:43 +02:00
"github.com/mhsanaei/3x-ui/v2/util/json_util"
2023-02-09 22:48:06 +03:30
)
2025-09-20 09:35:50 +02:00
// InboundConfig represents an Xray inbound configuration.
// It defines how Xray accepts incoming connections including protocol, port, and settings.
2023-02-09 22:48:06 +03:30
type InboundConfig struct {
2023-05-13 13:24:44 +03:30
Listen json_util.RawMessage `json:"listen"` // listen cannot be an empty string
2023-02-09 22:48:06 +03:30
Port int `json:"port"`
Protocol string `json:"protocol"`
Settings json_util.RawMessage `json:"settings"`
StreamSettings json_util.RawMessage `json:"streamSettings"`
Tag string `json:"tag"`
Sniffing json_util.RawMessage `json:"sniffing"`
}
2025-09-20 09:35:50 +02:00
// Equals compares two InboundConfig instances for deep equality.
2023-02-09 22:48:06 +03:30
func (c *InboundConfig) Equals(other *InboundConfig) bool {
if !bytes.Equal(c.Listen, other.Listen) {
return false
}
if c.Port != other.Port {
return false
}
if c.Protocol != other.Protocol {
return false
}
if !bytes.Equal(c.Settings, other.Settings) {
return false
}
if !bytes.Equal(c.StreamSettings, other.StreamSettings) {
return false
}
if c.Tag != other.Tag {
return false
}
if !bytes.Equal(c.Sniffing, other.Sniffing) {
return false
}
return true
}