mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 12:40:11 +00:00
fix core selector
This commit is contained in:
@@ -43,12 +43,13 @@ func isSupported(protocol string, protocols []string) bool {
|
|||||||
func (s *Selector) AddNode(tag string, info *panel.NodeInfo, option *conf.Options) error {
|
func (s *Selector) AddNode(tag string, info *panel.NodeInfo, option *conf.Options) error {
|
||||||
for i, c := range s.cores {
|
for i, c := range s.cores {
|
||||||
if len(option.Core) == 0 {
|
if len(option.Core) == 0 {
|
||||||
if isSupported(info.Type, c.Protocols()) {
|
if !isSupported(info.Type, c.Protocols()) {
|
||||||
option.Core = c.Type()
|
continue
|
||||||
err := option.UnmarshalJSON(option.RawOptions)
|
}
|
||||||
if err != nil {
|
option.Core = c.Type()
|
||||||
return fmt.Errorf("unmarshal option error: %s", err)
|
err := option.UnmarshalJSON(option.RawOptions)
|
||||||
}
|
if err != nil {
|
||||||
|
return fmt.Errorf("unmarshal option error: %s", err)
|
||||||
}
|
}
|
||||||
} else if option.Core != c.Type() {
|
} else if option.Core != c.Type() {
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user