mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-03-04 15:13:06 +00:00
fix: replaced method in GetXrayConfig, limit user connection
This commit is contained in:
parent
24b367b82f
commit
65ab4fb489
1 changed files with 4 additions and 2 deletions
|
|
@ -97,12 +97,11 @@ func (s *XrayService) GetXrayConfig() (*xray.Config, error) {
|
|||
if !clientTraffic.Enable {
|
||||
clients = RemoveIndex(clients, index-indexDecrease)
|
||||
indexDecrease++
|
||||
logger.Infof("Remove Inbound User %s due to expiration or traffic limit", c["email"])
|
||||
logger.Info("Remove Inbound User ", c["email"], " due to expire or traffic limit")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// clear client config for additional parameters
|
||||
var final_clients []interface{}
|
||||
for _, client := range clients {
|
||||
|
|
@ -123,6 +122,9 @@ func (s *XrayService) GetXrayConfig() (*xray.Config, error) {
|
|||
final_clients = append(final_clients, interface{}(c))
|
||||
}
|
||||
|
||||
// Add maxClient setting
|
||||
settings["maxClient"] = 1 // Replace with desired maxClient value
|
||||
|
||||
settings["clients"] = final_clients
|
||||
modifiedSettings, err := json.MarshalIndent(settings, "", " ")
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue