mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 04:30:08 +00:00
update
fix deps cycle update example fix color for X25519 output supported cores message
This commit is contained in:
12
core/core.go
12
core/core.go
@@ -2,6 +2,8 @@ package core
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/Yuzuki616/V2bX/conf"
|
||||
)
|
||||
|
||||
@@ -10,7 +12,7 @@ var (
|
||||
)
|
||||
|
||||
func NewCore(c *conf.CoreConfig) (Core, error) {
|
||||
if f, ok := cores[c.Type]; ok {
|
||||
if f, ok := cores[strings.ToLower(c.Type)]; ok {
|
||||
return f(c)
|
||||
} else {
|
||||
return nil, errors.New("unknown core type")
|
||||
@@ -20,3 +22,11 @@ func NewCore(c *conf.CoreConfig) (Core, error) {
|
||||
func RegisterCore(t string, f func(c *conf.CoreConfig) (Core, error)) {
|
||||
cores[t] = f
|
||||
}
|
||||
|
||||
func RegisteredCore() []string {
|
||||
cs := make([]string, 0, len(cores))
|
||||
for k := range cores {
|
||||
cs = append(cs, k)
|
||||
}
|
||||
return cs
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//go:build hy
|
||||
|
||||
package core
|
||||
package imports
|
||||
|
||||
// not works for now
|
||||
//import _ "github.com/Yuzuki616/V2bX/core/hy"
|
||||
@@ -1,5 +1,5 @@
|
||||
//go:build xray
|
||||
|
||||
package core
|
||||
package imports
|
||||
|
||||
import _ "github.com/Yuzuki616/V2bX/core/xray"
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
// The following are necessary as they register handlers in their init functions.
|
||||
|
||||
// Mandatory features. Can't remove unless there are replacements.
|
||||
_ "github.com/xtls/xray-core/app/dispatcher"
|
||||
_ "github.com/Yuzuki616/V2bX/core/xray/app/dispatcher"
|
||||
_ "github.com/xtls/xray-core/app/proxyman/inbound"
|
||||
_ "github.com/xtls/xray-core/app/proxyman/outbound"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user