Documentation
¶
Index ¶
Constants ¶
View Source
const ( OK_REQUEST int = -1 UNKNOWN_TRANSPORT int = 0 UNKNOWN_SID int = 1 BAD_HANDSHAKE_METHOD int = 2 BAD_REQUEST int = 3 FORBIDDEN int = 4 UNSUPPORTED_PROTOCOL_VERSION int = 5 )
*
- Protocol errors mappings.
View Source
const Protocol = 4
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
type Server interface {
events.EventEmitter
SetHttpServer(*types.HttpServer)
HttpServer() *types.HttpServer
Opts() *config.ServerOptions
Clients() *sync.Map
ClientsCount() uint64
Upgrades(string) *types.Set
Close() Server
HandleRequest(*types.HttpContext)
HandleUpgrade(*types.HttpContext)
Attach(*types.HttpServer, interface{})
GenerateId(*types.HttpContext) (string, error)
}
func Attach ¶
func Attach(server *types.HttpServer, options interface{}) Server
type Socket ¶
type Socket interface {
events.EventEmitter
ID() string
Server() Server
Request() *types.HttpContext
Upgraded() bool
Upgrading() bool
MaybeUpgrade(transports.Transport)
ReadyState() string
SetReadyState(string)
Transport() transports.Transport
Send(io.Reader, *packet.Options, func(transports.Transport)) Socket
Close(bool)
}
func NewSocket ¶
func NewSocket(id string, server Server, transport transports.Transport, ctx *types.HttpContext, protocol int) Socket
Click to show internal directories.
Click to hide internal directories.