I want to parse a requested url. When I used Socket.IO I had a request-object I could parse. How can I get the path from the URL?
For example:
http://localhost:4000/foo
I need to extract "foo" from the URL.
I've tried :
io.sockets.on('connection', function (socket){
console.log(socket.handshake.address.address);
console.log(socket.handshake.url);
}
But it they don't print "foo".