add pkgs from core
This commit is contained in:
@ -11,8 +11,8 @@ import (
|
||||
"github.com/go-gost/core/logger"
|
||||
md "github.com/go-gost/core/metadata"
|
||||
metrics "github.com/go-gost/core/metrics/wrapper"
|
||||
"github.com/go-gost/core/registry"
|
||||
ws_util "github.com/go-gost/x/internal/util/ws"
|
||||
"github.com/go-gost/x/registry"
|
||||
"github.com/gorilla/websocket"
|
||||
)
|
||||
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"time"
|
||||
|
||||
mdata "github.com/go-gost/core/metadata"
|
||||
mdx "github.com/go-gost/x/metadata"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -39,23 +40,23 @@ func (l *wsListener) parseMetadata(md mdata.Metadata) (err error) {
|
||||
header = "header"
|
||||
)
|
||||
|
||||
l.md.path = mdata.GetString(md, path)
|
||||
l.md.path = mdx.GetString(md, path)
|
||||
if l.md.path == "" {
|
||||
l.md.path = defaultPath
|
||||
}
|
||||
|
||||
l.md.backlog = mdata.GetInt(md, backlog)
|
||||
l.md.backlog = mdx.GetInt(md, backlog)
|
||||
if l.md.backlog <= 0 {
|
||||
l.md.backlog = defaultBacklog
|
||||
}
|
||||
|
||||
l.md.handshakeTimeout = mdata.GetDuration(md, handshakeTimeout)
|
||||
l.md.readHeaderTimeout = mdata.GetDuration(md, readHeaderTimeout)
|
||||
l.md.readBufferSize = mdata.GetInt(md, readBufferSize)
|
||||
l.md.writeBufferSize = mdata.GetInt(md, writeBufferSize)
|
||||
l.md.enableCompression = mdata.GetBool(md, enableCompression)
|
||||
l.md.handshakeTimeout = mdx.GetDuration(md, handshakeTimeout)
|
||||
l.md.readHeaderTimeout = mdx.GetDuration(md, readHeaderTimeout)
|
||||
l.md.readBufferSize = mdx.GetInt(md, readBufferSize)
|
||||
l.md.writeBufferSize = mdx.GetInt(md, writeBufferSize)
|
||||
l.md.enableCompression = mdx.GetBool(md, enableCompression)
|
||||
|
||||
if mm := mdata.GetStringMapString(md, header); len(mm) > 0 {
|
||||
if mm := mdx.GetStringMapString(md, header); len(mm) > 0 {
|
||||
hd := http.Header{}
|
||||
for k, v := range mm {
|
||||
hd.Add(k, v)
|
||||
|
Reference in New Issue
Block a user