We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi There, I find it hard to integrate a sockjs server (http://godoc.org/gopkg.in/igm/sockjs-go.v2/sockjs) as the handler return an http.Handler type.
Here's the initializer:
var messageHandler = sockjs.NewHandler("/api/messages", sockjs.DefaultOptions, func(session sockjs.Session) { go func() { receiveMessage(session) }() })
I can't just wrap it in a func (c *gin.Context) so I guess there's probably another way..? Thanks for help.
func (c *gin.Context)
The text was updated successfully, but these errors were encountered:
You can go to a lower level of the framework, please check this: #51
Sorry, something went wrong.
#51 issue and example works perfectly. Thank you Javier!
For the sake of clarity for those interested:
func messageHandler(c *gin.Context) { sockjsHandler := sockjs.NewHandler("/api/messages", sockjs.DefaultOptions, func(session sockjs.Session) { go func() { receiveMessage(session) }() }) sockjsHandler.ServeHTTP(c.Writer, c.Request) }
@gplume great, to avoid future issues like this, I'll update the readme soon.
javierprovecho
No branches or pull requests
Hi There,
I find it hard to integrate a sockjs server (http://godoc.org/gopkg.in/igm/sockjs-go.v2/sockjs) as the handler return an http.Handler type.
Here's the initializer:
I can't just wrap it in a
func (c *gin.Context)
so I guess there's probably another way..?Thanks for help.
The text was updated successfully, but these errors were encountered: