mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 20:50:09 +00:00
fix bugs,optimize memory
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
func InboundBuilder(config *Config, nodeInfo *api.NodeInfo, tag string) (*core.InboundHandlerConfig, error) {
|
||||
var proxySetting interface{}
|
||||
if nodeInfo.NodeType == "V2ray" {
|
||||
defer func() { nodeInfo.V2ray = nil }()
|
||||
if nodeInfo.EnableVless {
|
||||
nodeInfo.V2ray.Inbounds[0].Protocol = "vless"
|
||||
// Enable fallback
|
||||
@@ -39,6 +40,7 @@ func InboundBuilder(config *Config, nodeInfo *api.NodeInfo, tag string) (*core.I
|
||||
proxySetting = &conf.VMessInboundConfig{}
|
||||
}
|
||||
} else if nodeInfo.NodeType == "Trojan" {
|
||||
defer func() { nodeInfo.V2ray = nil; nodeInfo.Trojan = nil }()
|
||||
nodeInfo.V2ray = &api.V2rayConfig{}
|
||||
nodeInfo.V2ray.Inbounds = make([]conf.InboundDetourConfig, 1)
|
||||
nodeInfo.V2ray.Inbounds[0].Protocol = "trojan"
|
||||
@@ -61,6 +63,7 @@ func InboundBuilder(config *Config, nodeInfo *api.NodeInfo, tag string) (*core.I
|
||||
t := conf.TransportProtocol(nodeInfo.SS.TransportProtocol)
|
||||
nodeInfo.V2ray.Inbounds[0].StreamSetting = &conf.StreamConfig{Network: &t}
|
||||
} else if nodeInfo.NodeType == "Shadowsocks" {
|
||||
defer func() { nodeInfo.V2ray = nil; nodeInfo.SS = nil }()
|
||||
nodeInfo.V2ray = &api.V2rayConfig{}
|
||||
nodeInfo.V2ray.Inbounds = []conf.InboundDetourConfig{{Protocol: "shadowsocks"}}
|
||||
proxySetting = &conf.ShadowsocksServerConfig{}
|
||||
|
||||
Reference in New Issue
Block a user