add weight for selector

This commit is contained in:
ginuerzh
2022-09-02 17:23:59 +08:00
parent c643014e12
commit 00f7fa2997
16 changed files with 109 additions and 45 deletions

View File

@ -10,7 +10,6 @@ import (
tls_util "github.com/go-gost/x/internal/util/tls"
"github.com/go-gost/x/metadata"
"github.com/go-gost/x/registry"
xs "github.com/go-gost/x/selector"
)
func ParseChain(cfg *config.ChainConfig) (chain.SelectableChainer, error) {
@ -142,7 +141,7 @@ func ParseChain(cfg *config.ChainConfig) (chain.SelectableChainer, error) {
sel = s
}
if sel == nil {
sel = xs.DefaultNodeSelector
sel = defaultNodeSelector()
}
group.WithSelector(sel).
WithBypass(bypass.BypassGroup(bypassList(hop.Bypass, hop.Bypasses...)...))