go-socket.io icon indicating copy to clipboard operation
go-socket.io copied to clipboard

How to access the connection request for using session

Open majimboo opened this issue 4 years ago • 2 comments

I used to do it like this:

// 	var request = so.Request()
// 	var session = sessions.GetSession(request, "sess_k", store)

But I can no longer access request with the new API.

majimboo avatar Aug 02 '19 07:08 majimboo

@majimboo I think if you want request header, then can use so.RemoteHeader() and if want url then can use so.URL() with new API.

cp-sumi-k avatar Oct 07 '20 11:10 cp-sumi-k

Is there any thing on this? We can get the header but how do we access the session data as to do that requires a http.Request and to save requires an http.RequestWriter

TroyKomodo avatar Oct 07 '20 16:10 TroyKomodo