I used a small script that attempts to connect to the website through a socket. I simply set the default timeout of the access-attempt to 10 seconds, and when the timeout was reached, I stated the url as invalid:
There might be some easier ways, but this one has worked fine for me