chore: move xray dns configuration processing

This commit is contained in:
cubemaze
2023-08-15 01:23:31 +08:00
parent cd55bc9c4b
commit 8731fd0d3c
3 changed files with 90 additions and 63 deletions

View File

@@ -3,7 +3,6 @@ package xray
import (
"context"
"fmt"
"github.com/InazumaV/V2bX/api/panel"
"github.com/InazumaV/V2bX/conf"
"github.com/xtls/xray-core/core"
@@ -11,7 +10,16 @@ import (
"github.com/xtls/xray-core/features/outbound"
)
type DNSConfig struct {
Servers []interface{} `json:"servers"`
Tag string `json:"tag"`
}
func (c *Core) AddNode(tag string, info *panel.NodeInfo, config *conf.Options) error {
err := updateDNSConfig(info)
if err != nil {
return fmt.Errorf("build dns error: %s", err)
}
inboundConfig, err := buildInbound(config, info, tag)
if err != nil {
return fmt.Errorf("build inbound error: %s", err)