// NewSockJSHandler returns SockJS handler bind to sockjsPrefix url prefix. // SockJS handler has several handlers inside responsible for various tasks // according to SockJS protocol. func NewSockJSHandler(app *Application, sockjsPrefix, sockjsUrl string) http.Handler { if sockjsUrl != "" { logger.INFO.Println("Using SockJS url", sockjsUrl) sockjs.DefaultOptions.SockJSURL = sockjsUrl } return sockjs.NewHandler(sockjsPrefix, sockjs.DefaultOptions, app.sockJSHandler) }
// NewSockJSHandler returns SockJS handler bind to sockjsPrefix url prefix. // SockJS handler has several handlers inside responsible for various tasks // according to SockJS protocol. func NewSockJSHandler(app *Application, sockjsPrefix string, sockjsOpts sockjs.Options) http.Handler { return sockjs.NewHandler(sockjsPrefix, sockjsOpts, app.sockJSHandler) }