Documentation
¶
Index ¶
- Constants
- Variables
- func AlwaysReady() bool
- func ClientConnect(wsURL string, headers http.Header, dialer *websocket.Dialer, ...)
- func DefaultErrorWriter(rw http.ResponseWriter, req *http.Request, code int, err error)
- type Authorizer
- type ConnectAuthorizer
- type ErrorWriter
- type Server
- func (s *Server) Dial(clientKey string, deadline time.Duration, proto, address string) (net.Conn, error)
- func (s *Server) Dialer(clientKey string, deadline time.Duration) dialer.Dialer
- func (s *Server) HasSession(clientKey string) bool
- func (s *Server) ServeHTTP(rw http.ResponseWriter, req *http.Request)
Constants ¶
View Source
const (
Data messageType = iota + 1
Connect
Error
)
Variables ¶
View Source
var (
PingWaitDuration = time.Duration(10 * time.Second)
PingWriteInterval = time.Duration(5 * time.Second)
MaxRead = 8192
)
Functions ¶
func AlwaysReady ¶
func AlwaysReady() bool
func ClientConnect ¶
func ClientConnect(wsURL string, headers http.Header, dialer *websocket.Dialer, auth ConnectAuthorizer, onConnect func(context.Context) error)
func DefaultErrorWriter ¶
func DefaultErrorWriter(rw http.ResponseWriter, req *http.Request, code int, err error)
Types ¶
type Authorizer ¶
type Authorizer func(req *http.Request) (clientKey string, authed bool, err error)
type ConnectAuthorizer ¶
type ConnectAuthorizer func(proto, address string) bool
type ErrorWriter ¶
type ErrorWriter func(rw http.ResponseWriter, req *http.Request, code int, err error)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Dial ¶
func (s *Server) Dial(clientKey string, deadline time.Duration, proto, address string) (net.Conn, error)
func (*Server) Dialer ¶
func (s *Server) Dialer(clientKey string, deadline time.Duration) dialer.Dialer
func (*Server) HasSession ¶
func (s *Server) HasSession(clientKey string) bool
Source Files
¶
Click to show internal directories.
Click to hide internal directories.