In my app.js (server), I need to know where the request came from (URL).
I am currently passing the URL as a parameter from the client:
socket.emit('request', window.location.href);
and process it server side
socket.on('request', function(url){ console.log(url); ... });
But this is clearly dangerous and unsafe (clients can send something to the server).
So, I guess ... is it possible to get the URL parameter only on the server side? Maybe from a socket object?
source share