Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: fce7f0a73a
Fetching contributors…

Cannot retrieve contributors at this time

158 lines (154 sloc) 5.804 kb
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<title>Demonstration - Debian mirrors HTTP redirector</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="no-email-collection" content="" />
<body onload="sendAjaxHEAD();">
<script type="text/javascript">
function createRequest() {
var request;
try {
request = new XMLHttpRequest();
} catch (exception) {
request = false;
if (!request)
alert("Could not create ajax object. Are you running IE?");
return request;
function sendAjaxHEAD() {
var req = createRequest();
var url = document.getElementById('mirror_selector').value;
if (!req)
return false;
document.getElementById('mirror_path').textContent = url;"HEAD", url, true);
req.setRequestHeader('X-Web-Demo', 'yep');
req.onreadystatechange = ajaxResponse;
document.getElementById('loading').innerHTML = 'Loading...';
return false;
function ajaxResponse() {
if (this.readyState == 4) {
document.getElementById('loading').innerHTML = '';
if (this.status != 200) {
alert("Oops, the server failed with '"+this.statusText+"'");
var ip = this.getResponseHeader("X-IP"),
as = this.getResponseHeader("X-AS"),
continent = this.getResponseHeader("X-Continent"),
country = this.getResponseHeader("X-Country"),
links = this.getResponseHeader("Link"),
type = this.getResponseHeader("X-Match-Type"),
popu = this.getResponseHeader("X-Population");
document.getElementById('ip').textContent = 'IP: '+ip;
document.getElementById('as').textContent = 'AS: '+as;
document.getElementById('country').textContent = 'Country: '+country;
document.getElementById('continent').textContent = 'Continent: '+continent;
links = links.replace(/; rel=duplicate; pri=[0-9]+/g,'');
links = links.replace(/(\u003C|\u003E)/g, '');
links = links.replace(/,/g, '</li><li>');
document.getElementById('mirrors').innerHTML = '<ul><li>'+links+'</li></ul>';
document.getElementById('type').textContent = 'Matched by: '+type;
document.getElementById('population').textContent = 'Out of a population of: '+popu+' mirrors';
document.getElementById('allheaders').value = this.getAllResponseHeaders();
<noscript>Sorry, the demo is javascript based. You can see, more or
less, what this demo shows by running:
<pre>HEAD http://thishost.tld/debian/</pre>
Your details, as seen by the redirector:
<div id="loading"></div>
<div id="ip"></div>
<div id="as"></div>
<div id="continent"></div>
<div id="country"></div>
Had you requested a file to <span id="mirror_path">/debian/</span>,
you would have been sent to one of the following mirrors:
<div id="mirrors"></div>
<div id="population"></div>
<div id="type"></div>
<button type="button" onclick="return sendAjaxHEAD();">Retry</button> |
<select id="mirror_selector" onchange="return sendAjaxHEAD();">
<option value="/debian/" selected="selected">/debian/</option>
<option value="/debian-backports/">/debian-backports/</option>
<option value="/debian-security/">/debian-security/</option>
<option value="/debian-archive/">/debian-archive/</option>
<div id="explanation">
The destination mirrors depends on many factors, from those mentioned
above, to the reachability, freshness, etc.<br/>
The <i>population</i> may be bigger than the number of mirrors listed
above, meaning there were other candidates but they were not considered
because of their distance to you.
<div id="issues">
<h2>Corrections and issue reporting</h2>
If any of the fields of the <i>your details</i> section is incorrect,
please refer to <a
href=""></a>. If your
details are correct there, then it might be a limitation of the free
version of their database. Otherwise, feel free to send them a <a
If you believe there's another mirror that could serve you better,
other than those listed above, please check the following before
contacting me (it's not mandatory, but you would save me some time):
<li>Make sure it is part of the official <a
href="">Debian mirrors
<li>It is up to date (the main archive is updated several times a day)</li>
<li>There's a file with the same name as the mirror's host name in the
project/trace/ directory (e.g.
All three points can be fixed by the mirror administrator, and only by
At some point there will be a page where you can check why a mirror is
disabled in the redirector.<br/>
If after all that, there's a mirror that would serve you better and it
isn't listed, please do send me an email along with the <a href="#"
onclick="document.getElementById('allheaders').style.display='block';return false;">
request headers</a> to the email address at the bottom of this page.
<textarea id="allheaders" style="display:none;" rows="8" cols="73">
<div id="footer">
<a href="/">Back to main page</a>
<p>Please send feedback to <a href="">Raphael
<img class="logo" src=""
alt="Small Debian logo" />
Jump to Line
Something went wrong with that request. Please try again.