add pkgs from core

This commit is contained in:
ginuerzh
2022-04-04 12:44:35 +08:00
parent 7eb3687e0e
commit a3346ad246
188 changed files with 6084 additions and 283 deletions

View File

@ -8,9 +8,9 @@ import (
"github.com/go-gost/core/connector"
md "github.com/go-gost/core/metadata"
"github.com/go-gost/core/registry"
"github.com/go-gost/x/internal/util/relay"
"github.com/go-gost/x/internal/util/ss"
"github.com/go-gost/x/registry"
"github.com/shadowsocks/go-shadowsocks2/core"
)

View File

@ -5,6 +5,7 @@ import (
"time"
mdata "github.com/go-gost/core/metadata"
mdx "github.com/go-gost/x/metadata"
)
type metadata struct {
@ -20,10 +21,10 @@ func (c *ssuConnector) parseMetadata(md mdata.Metadata) (err error) {
bufferSize = "bufferSize" // udp buffer size
)
c.md.key = mdata.GetString(md, key)
c.md.connectTimeout = mdata.GetDuration(md, connectTimeout)
c.md.key = mdx.GetString(md, key)
c.md.connectTimeout = mdx.GetDuration(md, connectTimeout)
if bs := mdata.GetInt(md, bufferSize); bs > 0 {
if bs := mdx.GetInt(md, bufferSize); bs > 0 {
c.md.bufferSize = int(math.Min(math.Max(float64(bs), 512), 64*1024))
} else {
c.md.bufferSize = 1500