Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mock a timeout url

I'm trying to mock a timeout from a webpage so that I can implement a "deal with timeout" feature.

Basically what I need is a URL of something that does not reply within X seconds.

Thanks in advance

Here's the code I have:

var req = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance();
req.overrideMimeType('text/plain; charset=utf-8');
req.open("GET", configurationURL, false);
req.variable = specificConfigurationURLTerminator;
setTimeout(function() {
    alert("aborting");
    req.abort();
}, this.configurationRetrievalTimeout);
req.send(null);
like image 247
ricardoespsanto Avatar asked Jan 24 '13 12:01

ricardoespsanto


1 Answers

Guys thank you so much for your prompt replies. I've found what I was looking for:

http://www.google.com:81/

basically doesn't respond not even with an error =) exactly what I need to trigger a timeout

like image 178
ricardoespsanto Avatar answered Sep 20 '22 12:09

ricardoespsanto