Adding a better check for socket url validation