Skip to content
This repository
tree: 229b2935d9
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 158 lines (154 sloc) 5.804 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Demonstration - Debian mirrors HTTP redirector</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="no-email-collection" content="http://www.unspam.com/noemailcollection" />
</head>
<body onload="sendAjaxHEAD();">
<h1>Demonstration</h1>
<script type="text/javascript">
//<![CDATA[
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;
    req.open("HEAD", url, true);
    req.setRequestHeader('X-Web-Demo', 'yep');
    req.onreadystatechange = ajaxResponse;
    document.getElementById('loading').innerHTML = 'Loading...';
    req.send();
    return false;
}
function ajaxResponse() {
    if (this.readyState == 4) {
document.getElementById('loading').innerHTML = '';
if (this.status != 200) {
alert("Oops, the server failed with '"+this.statusText+"'");
return;
}
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();
    }
}
//]]>
</script>
<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>
</noscript>
<div>
    <p>
Your details, as seen by the redirector:
    </p>
    <noscript>
unavailable
    </noscript>
    <div id="loading"></div>
    <div id="ip"></div>
    <div id="as"></div>
    <div id="continent"></div>
    <div id="country"></div>
    <p>
Had you requested a file to <span id="mirror_path">/debian/</span>,
you would have been sent to one of the following mirrors:
    </p>
    <noscript>
unavailable
    </noscript>
    <div id="mirrors"></div>
    <div id="population"></div>
    <div id="type"></div>
</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>
</select>
<div id="explanation">
<h2>Explanation</h2>
<p>
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.
</p>
</div>
<div id="issues">
<h2>Corrections and issue reporting</h2>
<p>
If any of the fields of the <i>your details</i> section is incorrect,
please refer to <a
href="http://www.maxmind.com/app/locate_my_ip">maxmind.com</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
href="http://www.maxmind.com/app/correction">correction</a>.<br/>
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):
</p>
<ol>
<li>Make sure it is part of the official <a
href="http://www.debian.org/mirrors/list">Debian mirrors
network</a></li>
<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.
http://mirror.tld/debian/project/trace/mirror.tld)</li>
</ol>
<p>
All three points can be fixed by the mirror administrator, and only by
her.<br/>
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">
</textarea>
</p>
</div>
<div id="footer">
    <a href="/">Back to main page</a>
    <center>
<p>Please send feedback to <a href="mailto:geissert@debian.org">Raphael
Geissert</a></p>
<img class="logo" src="http://www.debian.org/logos/openlogo-nd-25.png"
alt="Small Debian logo" />
    </center>
</div>
</body>
</html>
Something went wrong with that request. Please try again.