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

@ -10,8 +10,8 @@ import (
"github.com/go-gost/core/dialer"
"github.com/go-gost/core/logger"
md "github.com/go-gost/core/metadata"
"github.com/go-gost/core/registry"
kcp_util "github.com/go-gost/x/internal/util/kcp"
"github.com/go-gost/x/registry"
"github.com/xtaci/kcp-go/v5"
"github.com/xtaci/smux"
"github.com/xtaci/tcpraw"

View File

@ -6,6 +6,7 @@ import (
mdata "github.com/go-gost/core/metadata"
kcp_util "github.com/go-gost/x/internal/util/kcp"
mdx "github.com/go-gost/x/metadata"
)
type metadata struct {
@ -19,7 +20,7 @@ func (d *kcpDialer) parseMetadata(md mdata.Metadata) (err error) {
handshakeTimeout = "handshakeTimeout"
)
if m := mdata.GetStringMap(md, config); len(m) > 0 {
if m := mdx.GetStringMap(md, config); len(m) > 0 {
b, err := json.Marshal(m)
if err != nil {
return err
@ -34,6 +35,6 @@ func (d *kcpDialer) parseMetadata(md mdata.Metadata) (err error) {
d.md.config = kcp_util.DefaultConfig
}
d.md.handshakeTimeout = mdata.GetDuration(md, handshakeTimeout)
d.md.handshakeTimeout = mdx.GetDuration(md, handshakeTimeout)
return
}