ws path漏修改
This commit is contained in:
parent
9f45590246
commit
8dfec52286
16
ws.go
16
ws.go
@ -63,8 +63,12 @@ func (tr *wsTransporter) Handshake(conn net.Conn, options ...HandshakeOption) (n
|
|||||||
if path == "" {
|
if path == "" {
|
||||||
path = defaultWSPath
|
path = defaultWSPath
|
||||||
}
|
}
|
||||||
url := url.URL{Scheme: "ws", Host: opts.Host, Path: path}
|
urlObj := url.URL{Scheme: "ws", Host: opts.Host, Path: path}
|
||||||
return websocketClientConn(url.String(), conn, nil, wsOptions)
|
urlStr, errUnescape := url.QueryUnescape(urlObj.String())
|
||||||
|
if errUnescape != nil {
|
||||||
|
log.Logf("[ws] URL QueryUnescape Error URL.String() -> %s", urlObj.String())
|
||||||
|
}
|
||||||
|
return websocketClientConn(urlStr, conn, nil, wsOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
type mwsTransporter struct {
|
type mwsTransporter struct {
|
||||||
@ -225,8 +229,12 @@ func (tr *wssTransporter) Handshake(conn net.Conn, options ...HandshakeOption) (
|
|||||||
if path == "" {
|
if path == "" {
|
||||||
path = defaultWSPath
|
path = defaultWSPath
|
||||||
}
|
}
|
||||||
url := url.URL{Scheme: "wss", Host: opts.Host, Path: path}
|
urlObj := url.URL{Scheme: "wss", Host: opts.Host, Path: path}
|
||||||
return websocketClientConn(url.String(), conn, opts.TLSConfig, wsOptions)
|
urlStr, errUnescape := url.QueryUnescape(urlObj.String())
|
||||||
|
if errUnescape != nil {
|
||||||
|
log.Logf("[ws] URL QueryUnescape Error URL.String() -> %s", urlObj.String())
|
||||||
|
}
|
||||||
|
return websocketClientConn(urlStr, conn, opts.TLSConfig, wsOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
type mwssTransporter struct {
|
type mwssTransporter struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user