Update: add config route

This commit is contained in:
Dreamacro
2018-07-15 22:23:20 +08:00
parent 0eef9bbf5d
commit 3cacfb8a7f
12 changed files with 319 additions and 77 deletions

View File

@ -16,8 +16,8 @@ import (
const (
Name = "clash"
DefalutHTTPPort = "7890"
DefalutSOCKSPort = "7891"
DefalutHTTPPort = 7890
DefalutSOCKSPort = 7891
)
var (
@ -26,6 +26,13 @@ var (
MMDBPath string
)
type General struct {
Mode *string `json:"mode,omitempty"`
AllowLan *bool `json:"allow-lan,omitempty"`
Port *int `json:"port,omitempty"`
SocksPort *int `json:"socks-port,omitempty"`
}
func init() {
currentUser, err := user.Current()
if err != nil {

7
constant/proxy.go Normal file
View File

@ -0,0 +1,7 @@
package constant
// ProxySignal is used to handle graceful shutdown of proxy
type ProxySignal struct {
Done chan<- struct{}
Closed <-chan struct{}
}