mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-03-01 01:20:49 +03:00

* [refactor] api controller * [fix] access log path better to not hardcode the access log path, maybe some ppl dont want to use the default ./access.log * [fix] set select options from logs paths in xray settings * [update] .gitignore * [lint] all .go files * [update] use status code for jsonMsg and 401 to unauthorize * [update] handle response status code via axios * [fix] set correct value if log paths is set to 'none' we also use the default value for the paths if its set to none * [fix] iplimit - only warning access log if f2b is installed
43 lines
990 B
Go
43 lines
990 B
Go
package xray
|
|
|
|
import (
|
|
"bytes"
|
|
|
|
"x-ui/util/json_util"
|
|
)
|
|
|
|
type InboundConfig struct {
|
|
Listen json_util.RawMessage `json:"listen"` // listen cannot be an empty string
|
|
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"`
|
|
}
|
|
|
|
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
|
|
}
|