I was trying to get the data at the handle_connection(...) function
I don't see that you tried anything. That function is called by socket_app_appcall(), which seems like a more appropriate place to inject the data of interest into the struct that is passed to handle_connection().