Skip to content

Commit

Permalink
clashapi: Add mode list
Browse files Browse the repository at this point in the history
  • Loading branch information
Zephyruso authored and nekohasekai committed Nov 24, 2024
1 parent 5c6d06e commit 9c35bc1
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions experimental/clashapi/configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ func configRouter(server *Server, logFactory log.Factory) http.Handler {
}

type configSchema struct {
Port int `json:"port"`
SocksPort int `json:"socks-port"`
RedirPort int `json:"redir-port"`
TProxyPort int `json:"tproxy-port"`
MixedPort int `json:"mixed-port"`
AllowLan bool `json:"allow-lan"`
BindAddress string `json:"bind-address"`
Mode string `json:"mode"`
LogLevel string `json:"log-level"`
IPv6 bool `json:"ipv6"`
Tun map[string]any `json:"tun"`
Port int `json:"port"`
SocksPort int `json:"socks-port"`
RedirPort int `json:"redir-port"`
TProxyPort int `json:"tproxy-port"`
MixedPort int `json:"mixed-port"`
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"`
}

func getConfigs(server *Server, logFactory log.Factory) func(w http.ResponseWriter, r *http.Request) {
Expand All @@ -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),
})
Expand Down

0 comments on commit 9c35bc1

Please sign in to comment.