mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-02-02 06:48:14 -05:00
update config
This commit is contained in:
parent
12e0e86979
commit
a4127588f7
38
api/api.go
38
api/api.go
@ -14,13 +14,13 @@ import (
|
|||||||
// API is the interface for different panel's api.
|
// API is the interface for different panel's api.
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
APIHost string `mapstructure:"ApiHost"`
|
APIHost string `mapstructure:"ApiHost"`
|
||||||
NodeID int `mapstructure:"NodeID"`
|
NodeID int `mapstructure:"NodeID"`
|
||||||
Key string `mapstructure:"ApiKey"`
|
Key string `mapstructure:"ApiKey"`
|
||||||
NodeType string `mapstructure:"NodeType"`
|
NodeType string `mapstructure:"NodeType"`
|
||||||
EnableVless bool `mapstructure:"EnableVless"`
|
EnableVless bool `mapstructure:"EnableVless"`
|
||||||
EnableXTLS bool `mapstructure:"EnableXTLS"`
|
EnableXTLS bool `mapstructure:"EnableXTLS"`
|
||||||
EnableSS2022 bool `mapstructure:"EnableSS2022"`
|
//EnableSS2022 bool `mapstructure:"EnableSS2022"`
|
||||||
Timeout int `mapstructure:"Timeout"`
|
Timeout int `mapstructure:"Timeout"`
|
||||||
SpeedLimit float64 `mapstructure:"SpeedLimit"`
|
SpeedLimit float64 `mapstructure:"SpeedLimit"`
|
||||||
DeviceLimit int `mapstructure:"DeviceLimit"`
|
DeviceLimit int `mapstructure:"DeviceLimit"`
|
||||||
@ -36,12 +36,12 @@ type ClientInfo struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
client *resty.Client
|
client *resty.Client
|
||||||
APIHost string
|
APIHost string
|
||||||
NodeID int
|
NodeID int
|
||||||
Key string
|
Key string
|
||||||
NodeType string
|
NodeType string
|
||||||
EnableSS2022 bool
|
//EnableSS2022 bool
|
||||||
EnableVless bool
|
EnableVless bool
|
||||||
EnableXTLS bool
|
EnableXTLS bool
|
||||||
SpeedLimit float64
|
SpeedLimit float64
|
||||||
@ -78,12 +78,12 @@ func New(apiConfig *Config) API {
|
|||||||
// Read local rule list
|
// Read local rule list
|
||||||
localRuleList := readLocalRuleList(apiConfig.RuleListPath)
|
localRuleList := readLocalRuleList(apiConfig.RuleListPath)
|
||||||
apiClient := &Client{
|
apiClient := &Client{
|
||||||
client: client,
|
client: client,
|
||||||
NodeID: apiConfig.NodeID,
|
NodeID: apiConfig.NodeID,
|
||||||
Key: apiConfig.Key,
|
Key: apiConfig.Key,
|
||||||
APIHost: apiConfig.APIHost,
|
APIHost: apiConfig.APIHost,
|
||||||
NodeType: apiConfig.NodeType,
|
NodeType: apiConfig.NodeType,
|
||||||
EnableSS2022: apiConfig.EnableSS2022,
|
//EnableSS2022: apiConfig.EnableSS2022,
|
||||||
EnableVless: apiConfig.EnableVless,
|
EnableVless: apiConfig.EnableVless,
|
||||||
EnableXTLS: apiConfig.EnableXTLS,
|
EnableXTLS: apiConfig.EnableXTLS,
|
||||||
SpeedLimit: apiConfig.SpeedLimit,
|
SpeedLimit: apiConfig.SpeedLimit,
|
||||||
|
@ -18,7 +18,6 @@ func (c *Client) Debug() {
|
|||||||
func (c *Client) assembleURL(path string) string {
|
func (c *Client) assembleURL(path string) string {
|
||||||
return c.APIHost + path
|
return c.APIHost + path
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) checkResponse(res *resty.Response, path string, err error) error {
|
func (c *Client) checkResponse(res *resty.Response, path string, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("request %s failed: %s", c.assembleURL(path), err)
|
return fmt.Errorf("request %s failed: %s", c.assembleURL(path), err)
|
||||||
|
@ -14,12 +14,11 @@ ConnetionConfig:
|
|||||||
BufferSize: 64 # The internal cache size of each connection, kB
|
BufferSize: 64 # The internal cache size of each connection, kB
|
||||||
Nodes:
|
Nodes:
|
||||||
-
|
-
|
||||||
PanelType: "SSpanel" # Panel type: SSpanel, V2board, PMpanel, Proxypanel
|
|
||||||
ApiConfig:
|
ApiConfig:
|
||||||
ApiHost: "http://127.0.0.1:667"
|
ApiHost: "http://127.0.0.1:667"
|
||||||
ApiKey: "123"
|
ApiKey: "123"
|
||||||
NodeID: 41
|
NodeID: 41
|
||||||
NodeType: V2ray # Node type: V2ray, Shadowsocks, Trojan, Shadowsocks-Plugin
|
NodeType: V2ray # Node type: V2ray, Shadowsocks, Trojan
|
||||||
Timeout: 30 # Timeout for the api request
|
Timeout: 30 # Timeout for the api request
|
||||||
EnableVless: false # Enable Vless for V2ray Type
|
EnableVless: false # Enable Vless for V2ray Type
|
||||||
EnableXTLS: false # Enable XTLS for V2ray and Trojan
|
EnableXTLS: false # Enable XTLS for V2ray and Trojan
|
||||||
@ -52,7 +51,6 @@ Nodes:
|
|||||||
ALICLOUD_ACCESS_KEY: aaa
|
ALICLOUD_ACCESS_KEY: aaa
|
||||||
ALICLOUD_SECRET_KEY: bbb
|
ALICLOUD_SECRET_KEY: bbb
|
||||||
# -
|
# -
|
||||||
# PanelType: "V2board" # Panel type: SSpanel, V2board
|
|
||||||
# ApiConfig:
|
# ApiConfig:
|
||||||
# ApiHost: "http://127.0.0.1:668"
|
# ApiHost: "http://127.0.0.1:668"
|
||||||
# ApiKey: "123"
|
# ApiKey: "123"
|
||||||
|
@ -23,9 +23,9 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
version = "0.8.2.6"
|
version = "v0.0.1"
|
||||||
codename = "XrayR"
|
codename = "V2bX"
|
||||||
intro = "A Xray backend that supports many panels"
|
intro = "A V2board backend based on Xray"
|
||||||
)
|
)
|
||||||
|
|
||||||
func showVersion() {
|
func showVersion() {
|
||||||
|
@ -16,7 +16,7 @@ type Config struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type NodesConfig struct {
|
type NodesConfig struct {
|
||||||
PanelType string `mapstructure:"PanelType"`
|
//PanelType string `mapstructure:"PanelType"`
|
||||||
ApiConfig *api.Config `mapstructure:"ApiConfig"`
|
ApiConfig *api.Config `mapstructure:"ApiConfig"`
|
||||||
ControllerConfig *controller.Config `mapstructure:"ControllerConfig"`
|
ControllerConfig *controller.Config `mapstructure:"ControllerConfig"`
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user