change project structure, fix online ip report bug

This commit is contained in:
yuzuki999
2022-08-16 13:04:33 +08:00
parent ca180a63c9
commit 27b97927c1
41 changed files with 121 additions and 152 deletions

View File

@@ -4,9 +4,9 @@ package node
import (
"encoding/json"
"fmt"
"github.com/Yuzuki616/V2bX/api"
"github.com/Yuzuki616/V2bX/app/legoCmd"
"github.com/Yuzuki616/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/conf"
"github.com/Yuzuki616/V2bX/node/legoCmd"
"github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/common/uuid"
"github.com/xtls/xray-core/core"
@@ -14,7 +14,7 @@ import (
)
//InboundBuilder build Inbound config for different protocol
func InboundBuilder(config *conf.ControllerConfig, nodeInfo *api.NodeInfo, tag string) (*core.InboundHandlerConfig, error) {
func InboundBuilder(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, tag string) (*core.InboundHandlerConfig, error) {
var proxySetting interface{}
if nodeInfo.NodeType == "V2ray" {
defer func() {
@@ -47,7 +47,7 @@ func InboundBuilder(config *conf.ControllerConfig, nodeInfo *api.NodeInfo, tag s
nodeInfo.V2ray = nil
nodeInfo.Trojan = nil
}()
nodeInfo.V2ray = &api.V2rayConfig{}
nodeInfo.V2ray = &panel.V2rayConfig{}
nodeInfo.V2ray.Inbounds = make([]coreConf.InboundDetourConfig, 1)
nodeInfo.V2ray.Inbounds[0].Protocol = "trojan"
// Enable fallback
@@ -72,7 +72,7 @@ func InboundBuilder(config *conf.ControllerConfig, nodeInfo *api.NodeInfo, tag s
defer func() {
nodeInfo.V2ray = nil
}()
nodeInfo.V2ray = &api.V2rayConfig{}
nodeInfo.V2ray = &panel.V2rayConfig{}
nodeInfo.V2ray.Inbounds = []coreConf.InboundDetourConfig{{Protocol: "shadowsocks"}}
proxySetting = &coreConf.ShadowsocksServerConfig{}
randomPasswd := uuid.New()