Usage with echo framework and cookie auth #36
Unanswered
TheLoneDeveloper
asked this question in
Q&A
Replies: 1 comment 2 replies
-
The following code snippet is for your reference: httpServer := types.NewWebServer(nil)
socketio := socket.NewServer(httpServer, nil)
socketio.On("connection", func(clients ...interface{}) {
client := clients[0].(*socket.Socket)
utils.Log().Success("cookies: %v", client.Client().Request().Request().Cookies())
}) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello just wanted to ask if this is possible with this package
I have an echo framework app that I’m adding realtime functions to and we use cookie based auth. Is it possible to read the session cookie inside io.On(“connection”) and save the user id to the socket data somehow? I have tried going through the package docs but I can’t see how you would get the original request like you can in the original JavaScript version of this package for nodejs?
Beta Was this translation helpful? Give feedback.
All reactions