mirror of
https://github.com/mpolden/echoip.git
synced 2024-11-10 07:27:22 +01:00
110 lines
3.0 KiB
HTML
110 lines
3.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>What is my IP address? — ifconfig.co</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="description" content="What is my IP address?">
|
|
<link href="//fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
|
|
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/pure-min.css">
|
|
<style>
|
|
html, .pure-g [class *= "pure-u"] {
|
|
font-family: "Roboto", sans-serif;
|
|
font-size: 15pt;
|
|
}
|
|
pre {
|
|
font-family: "Monaco", "Menlo", "Consolas", "Courier New", monospace;
|
|
font-size: 12pt;
|
|
}
|
|
body {
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
max-width: 80%;
|
|
}
|
|
.ip {
|
|
border: 1px solid #cbcbcb;
|
|
background: #f2f2f2;
|
|
font-size: 36px;
|
|
}
|
|
#footer {
|
|
font-size: 12pt;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="pure-g">
|
|
<div class="pure-u-1-1">
|
|
<h1>What is my IP address?</h1>
|
|
<p><code class="ip">{{ .IP }}</code></p>
|
|
<p>Multiple command line HTTP clients are supported,
|
|
including <a href="https://curl.haxx.se/">curl</a>, <a href="https://github.com/jkbrzt/httpie">httpie</a>, <a href="https://www.gnu.org/software/wget/">GNU
|
|
Wget</a>
|
|
and <a href="https://www.freebsd.org/cgi/man.cgi?fetch(1)">fetch</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div class="pure-g">
|
|
<div class="pure-u-1-2">
|
|
<p>CLI examples:</p>
|
|
<pre>
|
|
$ curl ifconfig.co
|
|
{{ .IP }}
|
|
|
|
$ http ifconfig.co
|
|
{{ .IP }}
|
|
|
|
$ wget -qO- ifconfig.co
|
|
{{ .IP }}
|
|
|
|
$ fetch -qo- http://ifconfig.co
|
|
{{ .IP }}
|
|
</pre>
|
|
{{ if .CountryLookup }}
|
|
<p>Country lookup:</p>
|
|
<pre>
|
|
$ http ifconfig.co/country
|
|
{{ .Country }}
|
|
</pre>
|
|
{{ end }}
|
|
</div>
|
|
<div class="pure-u-1-2">
|
|
<p>JSON output:</p>
|
|
<pre>
|
|
$ http --json ifconfig.co
|
|
HTTP/1.1 200 OK
|
|
Content-Length: 61
|
|
Content-Type: application/json
|
|
Date: Fri, 15 Apr 2016 17:26:53 GMT
|
|
|
|
{ {{ if .CountryLookup }}
|
|
"country": "{{ .Country }}",{{ end }}{{ if .ReverseLookup }}
|
|
"hostname": "{{ .Hostname }}",{{ end }}
|
|
"ip": "{{ .IP }}"
|
|
}
|
|
</pre>
|
|
{{ if .PortTesting }}
|
|
<p>Testing port connectivity (only supports JSON output):</p>
|
|
<pre>
|
|
http --json localhost:8080/port/8080
|
|
HTTP/1.1 200 OK
|
|
Content-Length: 47
|
|
Content-Type: application/json
|
|
Date: Fri, 15 Apr 2016 18:47:20 GMT
|
|
|
|
{
|
|
"ip": "127.0.0.1",
|
|
"port": 8080,
|
|
"reachable": true
|
|
}
|
|
</pre>
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
<div class="pure-g">
|
|
<div class="pure-u-1-1" id="footer">
|
|
<p>To force IPv4 lookup you can use the <a href="http://v4.ifconfig.co">v4 subdomain</a> (<a href="http://v6.ifconfig.co">or v6 for IPv6</a>).</p>
|
|
</div>
|
|
</div>
|
|
<a href="https://github.com/martinp/ipd"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a>
|
|
</body>
|
|
</html>
|