vtun/common/config/config.go
2022-03-20 21:36:07 +08:00

30 lines
513 B
Go

package config
import (
"encoding/json"
"log"
"github.com/net-byte/vtun/common/cipher"
)
type Config struct {
LocalAddr string
ServerAddr string
CIDR string
Key string
Protocol string
DNS string
WebSocketPath string
ServerMode bool
GlobalMode bool
Obfs bool
MTU int
Timeout int
}
func (config *Config) Init() {
cipher.GenerateKey(config.Key)
json, _ := json.Marshal(config)
log.Printf("init config:%s", string(json))
}