-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
65 lines (65 loc) · 5.2 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>colasloth</title>
<meta charset="utf-8">
<meta name="description" content="A drop-in replacement for localhost.">
<meta name="author" content="colasloth.com">
<link type="text/css" href="/css/styles.css" media="all" rel="stylesheet">
</head>
<body>
<div class="content">
<header>
<h1>colasloth</h1>
</header>
<section id="what">
<h3>What is this?</h3>
<p>
The domain <span class="highlight">colasloth.com</span> is just like any other domain, with the exception that it simply resolves to <span class="mono">127.0.0.1</span>, i.e. <span class="mono">localhost</span>, instead of pointing to the address of a specific machine. All subdomains under the domain also resolve to <span class="mono">localhost</span>, which can be useful in many situations.
</p>
</section>
<section id="how">
<h3>How does it work?</h3>
<p>
The DNS records of the domain are configured in a way that directs all requests to <span class="mono">localhost</span>. This is achieved with an A record for <span class="mono">colasloth.com</span> pointing at <span class="mono">127.0.0.1</span>, and another A record for the wildcard <span class="mono">*.colasloth.com</span> doing the same. This means that URLs such as <span class="mono">foo.bar.colasloth.com</span> also resolve to <span class="mono">localhost</span>.
</p>
<p>
The same applies to IPv6 — identical AAAA records exist, pointing at <span class="mono">::1</span>.
</p>
<p>
You can verify this with an <span class="mono">nslookup</span> or <span class="mono">dig</span> to <span class="highlight">colasloth.com</span> or any subdomain under it. You can also rest assured that requests to <span class="highlight">colasloth.com</span> never leave your machine – the route the packets in your requests take can be checked by running a <span class="mono">traceroute</span> for the domain.
</p>
</section>
<section id="why">
<h3>But why?</h3>
<p>
In short: to simplify configuration.
</p>
<p>
Using a domain such as <span class="highlight">colasloth.com</span> during development of web applications enables teams to work together on a project, without requiring every collaborator to manually edit their hosts file. A good example scenario is where a reverse proxy is used locally to receive requests at port 80, delegating traffic onwards to various networking applications running at different ports. In this case requests to <span class="mono">http://colasloth.com</span> will appear as they are to the reverse proxy, and can be forwarded to the correct application accordingly. E.g. you could configure your proxy to point <span class="mono">api.colasloth.com</span> at your REST API, <span class="mono">colasloth.com</span> at your frontend, and <span class="mono">static.colasloth.com</span> at your static file server – all at the same time. As such, the development environment can be made to closely mimic the environment used in production.
</p>
<p>
To remove all uncertainty: <span class="highlight">colasloth.com</span> is obviously free to use for any project – no strings attached. The domain will continue to function the way it does indefinitely, barring any unforeseen circumstances, so you can be confident that your development environments will work in the future as well.
</p>
<p>
As of 2022, the domain is registered until 2031, which should probably be Good Enough™ for anyone looking to use this domain for its intended purpose.
</p>
</section>
<section id="tls">
<h3>What about TLS?</h3>
<p>
Unfortunately, certificates can be easily be revoked once the private key is "leaked", and clearly we can't have nice things with similar ease.
</p>
<p>
However, I'll happily provide TLS certificates upon request, subject to rate limits set by the certificate authority. What you'll get is a certificate (<span class="mono">fullchain.pem</span>, <span class="mono">chain.pem</span>, and <span class="mono">cert.pem</span>) and <b>individual private key</b> (<span class="mono">privkey.pem</span>) covering both <span class="mono">colasloth.com</span> and <span class="mono">*.colasloth.com</span>, issued by <a href="https://letsencrypt.org/" target="_blank">Let's Encrypt</a>. The private key will only be provided to you, so the certificate will only be revoked if you leak it to an untrusted party. I'll also send you a renewed certificate some week or so before expiry, until you tell me to stop.
</p>
<p>
If this sounds of interest, let me know by contacting me over <a href="mailto:main@xoudini.com?subject=colasloth.com%20certificate">email</a> or <a href="https://twitter.com/xoudini" target="_blank">the bird app</a>. I don't currently have an automated system to handle this, but in case of sufficient interest, I'll probably set something up.
</p>
</section>
<footer>
<small>And yes: colasloth is an anagram of localhost.</small>
</footer>
</div>
</body>
</html>