mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
return TCPing test + External proxy should no longer show : null (#1621)
When Subscription Json is enabled in Alireza x-ui +v1.10.0 - TCPing test in apps such as v2rayNG should return again - External proxy should no longer show ": null" also: - Preserves VMess compatibility properly - Keeps level consistent - Avoids empty flow - Matches standard Xray schema precisely
This commit is contained in:
@@ -309,19 +309,39 @@ func (s *SubJsonService) genVnext(inbound *model.Inbound, streamSettings json_ut
|
||||
|
||||
outbound.Protocol = string(inbound.Protocol)
|
||||
outbound.Tag = "proxy"
|
||||
|
||||
if s.mux != "" {
|
||||
outbound.Mux = json_util.RawMessage(s.mux)
|
||||
}
|
||||
|
||||
outbound.StreamSettings = streamSettings
|
||||
settings := make(map[string]any)
|
||||
settings["address"] = inbound.Listen
|
||||
settings["port"] = inbound.Port
|
||||
settings["id"] = client.ID
|
||||
if inbound.Protocol == model.VLESS {
|
||||
settings["flow"] = client.Flow
|
||||
settings["encryption"] = encryption
|
||||
|
||||
// Build standard Xray/V2Ray schema
|
||||
user := map[string]any{
|
||||
"id": client.ID,
|
||||
"level": 8,
|
||||
}
|
||||
|
||||
if inbound.Protocol == model.VLESS {
|
||||
user["encryption"] = encryption
|
||||
if client.Flow != "" {
|
||||
user["flow"] = client.Flow
|
||||
}
|
||||
} else {
|
||||
// VMess
|
||||
user["alterId"] = 0
|
||||
user["security"] = "auto"
|
||||
}
|
||||
|
||||
vnext := map[string]any{
|
||||
"address": inbound.Listen,
|
||||
"port": inbound.Port,
|
||||
"users": []any{user},
|
||||
}
|
||||
|
||||
outbound.Settings = map[string]any{
|
||||
"vnext": []any{vnext},
|
||||
}
|
||||
outbound.Settings = settings
|
||||
|
||||
result, _ := json.MarshalIndent(outbound, "", " ")
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user