Merge from remote branch

This commit is contained in:
yaling888
2021-07-28 22:13:21 +08:00
33 changed files with 1549 additions and 142 deletions

View File

@ -18,7 +18,8 @@ const (
HTTP Type = iota
HTTPCONNECT
SOCKS
SOCKS4
SOCKS5
REDIR
TPROXY
TUN
@ -47,7 +48,9 @@ func (t Type) String() string {
return "HTTP"
case HTTPCONNECT:
return "HTTP Connect"
case SOCKS:
case SOCKS4:
return "Socks4"
case SOCKS5:
return "Socks5"
case REDIR:
return "Redir"

View File

@ -9,21 +9,19 @@ import (
const Name = "clash"
// Path is used to get the configuration path
var Path *path
type path struct {
homeDir string
configFile string
}
func init() {
var Path = func() *path {
homeDir, err := os.UserHomeDir()
if err != nil {
homeDir, _ = os.Getwd()
}
homeDir = P.Join(homeDir, ".config", Name)
Path = &path{homeDir: homeDir, configFile: "config.yaml"}
return &path{homeDir: homeDir, configFile: "config.yaml"}
}()
type path struct {
homeDir string
configFile string
}
// SetHomeDir is used to set the configuration path