[v5] get complete HttpContext in socket.io event #3339
-
Hi there! I use socket.io with adonisjs as described in the cookbook. Via adonisjs middleware i extend the request with some useful informations. In socket.io i need this kind of informations and some cookie infos inside the initial eventhandler: io.engine.on("initial_headers", (headers, request) => {
// how can i get here the complete adonisjs HttpContent (Request, Cookies)?
headers["test"] = "123";
headers["set-cookie"] = "mycookie=456";
}); The "initial_headers" event is the first request in socket.io described here: docs Inside "initial_headers" the headers and request is different from the adonisjs Header and Request. How can i access the needed informations inside the event handler? Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
After some hours a find a way via middleware to get the needed informations 😃👍 |
Beta Was this translation helpful? Give feedback.
After some hours a find a way via middleware to get the needed informations 😃👍