fix bug,fix spelling mistakes,del redundant code

This commit is contained in:
yuzuki999
2022-06-04 17:12:28 +08:00
parent 8c9786a4d5
commit 0b7eb9972e
25 changed files with 51 additions and 92 deletions

View File

@@ -8,7 +8,7 @@ import (
"time"
"github.com/Yuzuki616/V2bX/api"
"github.com/Yuzuki616/V2bX/common/legocmd"
"github.com/Yuzuki616/V2bX/common/legoCmd"
"github.com/xtls/xray-core/common/protocol"
"github.com/xtls/xray-core/common/task"
"github.com/xtls/xray-core/core"
@@ -168,7 +168,7 @@ func (c *Controller) nodeInfoMonitor() (err error) {
// Check Cert
if c.nodeInfo.EnableTls && c.config.CertConfig.CertMode != "none" &&
(c.config.CertConfig.CertMode == "dns" || c.config.CertConfig.CertMode == "http") {
lego, err := legocmd.New()
lego, err := legoCmd.New()
if err != nil {
log.Print(err)
}

View File

@@ -1,11 +1,11 @@
//Package generate the InbounderConfig used by add inbound
// Package controller the InbounderConfig used by add inbound
package controller
import (
"encoding/json"
"fmt"
"github.com/Yuzuki616/V2bX/api"
"github.com/Yuzuki616/V2bX/common/legocmd"
"github.com/Yuzuki616/V2bX/common/legoCmd"
"github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/common/uuid"
"github.com/xtls/xray-core/core"
@@ -178,7 +178,7 @@ func getCertFile(certConfig *CertConfig) (certFile string, keyFile string, err e
}
return certConfig.CertFile, certConfig.KeyFile, nil
} else if certConfig.CertMode == "dns" {
lego, err := legocmd.New()
lego, err := legoCmd.New()
if err != nil {
return "", "", err
}
@@ -188,7 +188,7 @@ func getCertFile(certConfig *CertConfig) (certFile string, keyFile string, err e
}
return certPath, keyPath, err
} else if certConfig.CertMode == "http" {
lego, err := legocmd.New()
lego, err := legoCmd.New()
if err != nil {
return "", "", err
}

View File

@@ -19,11 +19,11 @@ func OutboundBuilder(config *Config, nodeInfo *api.NodeInfo, tag string) (*core.
// Build Send IP address
if config.SendIP != "" {
ipAddress := net.ParseAddress(config.SendIP)
outboundDetourConfig.SendThrough = &conf.Address{ipAddress}
outboundDetourConfig.SendThrough = &conf.Address{Address: ipAddress}
}
// Freedom Protocol setting
var domainStrategy string = "Asis"
var domainStrategy = "Asis"
if config.EnableDNS {
if config.DNSType != "" {
domainStrategy = config.DNSType
@@ -41,7 +41,7 @@ func OutboundBuilder(config *Config, nodeInfo *api.NodeInfo, tag string) (*core.
var setting json.RawMessage
setting, err := json.Marshal(proxySetting)
if err != nil {
return nil, fmt.Errorf("Marshal proxy %s config fialed: %s", nodeInfo.NodeType, err)
return nil, fmt.Errorf("marshal proxy %s config fialed: %s", nodeInfo.NodeType, err)
}
outboundDetourConfig.Settings = &setting
return outboundDetourConfig.Build()