ing
This commit is contained in:
parent
032f2604e5
commit
b19cb58c3e
|
@ -171,7 +171,7 @@ func NewSocket(sb SocketBuilder, parentContext cuc.Context) (Socket, error) {
|
||||||
url := sb.GetURL()
|
url := sb.GetURL()
|
||||||
reqHeader := sb.GetRequestHeader()
|
reqHeader := sb.GetRequestHeader()
|
||||||
|
|
||||||
conn, res, err := d.Dial(url.String(), reqHeader)
|
conn, res, err := d.Dial(url, reqHeader)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ type SocketBuilder interface {
|
||||||
SocketContext(parent cuc.Context) SocketContext
|
SocketContext(parent cuc.Context) SocketContext
|
||||||
SocketHandler() SocketHandler
|
SocketHandler() SocketHandler
|
||||||
|
|
||||||
GetURL() *url.URL
|
GetURL() string
|
||||||
GetRequestCookie() http.CookieJar
|
GetRequestCookie() http.CookieJar
|
||||||
GetRequestHeader() http.Header
|
GetRequestHeader() http.Header
|
||||||
GetSubProtocols() []string
|
GetSubProtocols() []string
|
||||||
|
|
|
@ -13,7 +13,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type SocketBuilders struct {
|
type SocketBuilders struct {
|
||||||
URL *url.URL
|
URL string
|
||||||
RequestCookie http.CookieJar
|
RequestCookie http.CookieJar
|
||||||
RequestHeader http.Header
|
RequestHeader http.Header
|
||||||
SubProtocols []string
|
SubProtocols []string
|
||||||
|
@ -51,7 +51,7 @@ func (sb *SocketBuilders) GetHandshakeTimeout() time.Duration {
|
||||||
return sb.HandshakeTimeout
|
return sb.HandshakeTimeout
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sb *SocketBuilders) GetURL() *url.URL {
|
func (sb *SocketBuilders) GetURL() string {
|
||||||
return sb.URL
|
return sb.URL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ func (sb *SocketBuilders) GetWriteBufferSize() int {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sb *SocketBuilders) Validate() {
|
func (sb *SocketBuilders) Validate() {
|
||||||
if nil == sb.URL {
|
if "" == sb.URL {
|
||||||
logging.Logger().Panic("Client Socket: URL must be specified")
|
logging.Logger().Panic("Client Socket: URL must be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user