websocket_fasthttp/client/socket_handler.go
crusader 58bfd4b982 ing
2017-11-30 10:11:53 +09:00

37 lines
746 B
Go

package client
import (
"crypto/tls"
"net"
"net/http"
"net/url"
"time"
cuc "git.loafle.net/commons_go/util/context"
)
type SocketHandler interface {
SocketContext(parent cuc.Context) SocketContext
GetURL() *url.URL
GetRequestCookie() http.CookieJar
GetRequestHeader() http.Header
GetSubProtocols() []string
EnableCompression() bool
UseProxy(req *http.Request) (*url.URL, error)
GetHandshakeTimeout() time.Duration
Dial(network, addr string) (net.Conn, error)
GetTLSConfig() *tls.Config
GetReadBufferSize() int
GetWriteBufferSize() int
// Validate is check handler value
// If you override ths method, must call
//
// func (sh *SocketHandlers) Validate() {
// sh.SocketHandlers.Validate()
// ...
// }
Validate()
}