Documentation ¶
Index ¶
- Variables
- func Close(namespace string) bool
- func CloseAll()
- func OnConnect(fns ...func(ctx echo.Context, conn socketio.Conn) error)
- func OnDisconnect(fns ...func(ctx echo.Context, conn socketio.Conn, msg string))
- func OnError(fns ...func(ctx echo.Context, conn socketio.Conn, e error))
- func OnEvent(fns ...func(esi.IWrapper))
- func OnNSConnect(nsp string, fns ...func(ctx echo.Context, conn socketio.Conn) error)
- func OnNSDisconnect(nsp string, fns ...func(ctx echo.Context, conn socketio.Conn, msg string))
- func OnNSError(nsp string, fns ...func(ctx echo.Context, conn socketio.Conn, e error))
- func OnNSEvent(nsp string, fns ...func(esi.IWrapper))
- func RegisterRoute(e echo.RouteRegister, cfg *Config, s ...func(*middleware.CORSConfig))
- func SocketIO(namespace string, cfg *Config) *esi.Wrapper
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var RequestChecker engineio.CheckerFunc = func(req *http.Request) (http.Header, error) { token := common.Setting(`socketio`).String(`token`) if len(token) == 0 { return nil, nil } post := req.Header.Get(`Token`) if len(post) == 0 { post = req.URL.Query().Get(`token`) } if token != post { if log.IsEnabled(log.LevelDebug) { log.Debugf(`[socketIO] invalid token: %q`, post) log.Debugf(`[socketIO] request headers: %+v`, req.Header) } return nil, echo.NewError(`invalid token`, code.InvalidToken) } return nil, nil }
Functions ¶
func OnDisconnect ¶
func OnNSConnect ¶
func OnNSDisconnect ¶
func RegisterRoute ¶
func RegisterRoute(e echo.RouteRegister, cfg *Config, s ...func(*middleware.CORSConfig))
Types ¶
Click to show internal directories.
Click to hide internal directories.