Documentation ¶
Index ¶
- Variables
- 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 RegisterRoute(e echo.RouteRegister, s ...func(*middleware.CORSConfig))
- 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 RegisterRoute ¶
func RegisterRoute(e echo.RouteRegister, s ...func(*middleware.CORSConfig))
Types ¶
Click to show internal directories.
Click to hide internal directories.