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