mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 04:30:08 +00:00
update sing-box support
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
||||
)
|
||||
|
||||
// BuildInbound build Inbound config for different protocol
|
||||
func buildInbound(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, tag string) (*core.InboundHandlerConfig, error) {
|
||||
func buildInbound(config *conf.Options, nodeInfo *panel.NodeInfo, tag string) (*core.InboundHandlerConfig, error) {
|
||||
in := &coreConf.InboundDetourConfig{}
|
||||
// Set network protocol
|
||||
t := coreConf.TransportProtocol(nodeInfo.Network)
|
||||
@@ -150,7 +150,7 @@ func buildInbound(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, tag s
|
||||
return in.Build()
|
||||
}
|
||||
|
||||
func buildV2ray(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, inbound *coreConf.InboundDetourConfig) error {
|
||||
func buildV2ray(config *conf.Options, nodeInfo *panel.NodeInfo, inbound *coreConf.InboundDetourConfig) error {
|
||||
if nodeInfo.ExtraConfig.EnableVless == "true" {
|
||||
//Set vless
|
||||
inbound.Protocol = "vless"
|
||||
@@ -213,7 +213,7 @@ func buildV2ray(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, inbound
|
||||
return nil
|
||||
}
|
||||
|
||||
func buildTrojan(config *conf.ControllerConfig, inbound *coreConf.InboundDetourConfig) error {
|
||||
func buildTrojan(config *conf.Options, inbound *coreConf.InboundDetourConfig) error {
|
||||
inbound.Protocol = "trojan"
|
||||
if config.XrayOptions.EnableFallback {
|
||||
// Set fallback
|
||||
@@ -237,7 +237,7 @@ func buildTrojan(config *conf.ControllerConfig, inbound *coreConf.InboundDetourC
|
||||
return nil
|
||||
}
|
||||
|
||||
func buildShadowsocks(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, inbound *coreConf.InboundDetourConfig) error {
|
||||
func buildShadowsocks(config *conf.Options, nodeInfo *panel.NodeInfo, inbound *coreConf.InboundDetourConfig) error {
|
||||
inbound.Protocol = "shadowsocks"
|
||||
settings := &coreConf.ShadowsocksServerConfig{
|
||||
Cipher: nodeInfo.Cipher,
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"github.com/xtls/xray-core/features/outbound"
|
||||
)
|
||||
|
||||
func (c *Core) AddNode(tag string, info *panel.NodeInfo, config *conf.ControllerConfig) error {
|
||||
func (c *Core) AddNode(tag string, info *panel.NodeInfo, config *conf.Options) error {
|
||||
inboundConfig, err := buildInbound(config, info, tag)
|
||||
if err != nil {
|
||||
return fmt.Errorf("build inbound error: %s", err)
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// BuildOutbound build freedom outbund config for addoutbound
|
||||
func buildOutbound(config *conf2.ControllerConfig, tag string) (*core.OutboundHandlerConfig, error) {
|
||||
func buildOutbound(config *conf2.Options, tag string) (*core.OutboundHandlerConfig, error) {
|
||||
outboundDetourConfig := &conf.OutboundDetourConfig{}
|
||||
outboundDetourConfig.Protocol = "freedom"
|
||||
outboundDetourConfig.Tag = tag
|
||||
|
||||
@@ -39,7 +39,7 @@ func New(c *conf.CoreConfig) (vCore.Core, error) {
|
||||
return &Core{Server: getCore(c.XrayConfig)}, nil
|
||||
}
|
||||
|
||||
func parseConnectionConfig(c *conf.ConnectionConfig) (policy *coreConf.Policy) {
|
||||
func parseConnectionConfig(c *conf.XrayConnectionConfig) (policy *coreConf.Policy) {
|
||||
policy = &coreConf.Policy{
|
||||
StatsUserUplink: true,
|
||||
StatsUserDownlink: true,
|
||||
|
||||
Reference in New Issue
Block a user