clashapi: Add mode list

This commit is contained in:
Zephyruso 2024-11-23 22:37:03 +08:00 committed by 世界
parent 5c6d06ea26
commit 9c35bc1bf2
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -26,6 +26,8 @@ type configSchema struct {
AllowLan bool `json:"allow-lan"`
BindAddress string `json:"bind-address"`
Mode string `json:"mode"`
// sing-box added
ModeList []string `json:"mode-list"`
LogLevel string `json:"log-level"`
IPv6 bool `json:"ipv6"`
Tun map[string]any `json:"tun"`
@ -41,6 +43,7 @@ func getConfigs(server *Server, logFactory log.Factory) func(w http.ResponseWrit
}
render.JSON(w, r, &configSchema{
Mode: server.mode,
ModeList: server.modeList,
BindAddress: "*",
LogLevel: log.FormatLevel(logLevel),
})