-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
105 lines (100 loc) · 3 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>What is my IP address? — ip.feep.me</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=Open+Sans" rel="stylesheet">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/pure/0.6.2/pure-min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/pure/0.6.2/grids-responsive-min.css">
<style>
html, .pure-g [class *= "pure-u"] {
font-family: "Open Sans", sans-serif;
}
pre {
font-family: "Monaco", "Menlo", "Consolas", "Courier New", monospace;
}
body {
margin-left: auto;
margin-right: auto;
max-width: 80%;
margin-bottom: 20px;
}
.ip {
border: 1px solid #cbcbcb;
background: #f2f2f2;
font-size: 36px;
padding: 6px;
}
</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 pure-u-md-1-2">
<h2>CLI examples:</h2>
<pre>
$ curl -L https://ip.feep.me
{{ .IP }}
$ http -b https://ip.feep.me
{{ .IP }}
$ wget -qO- ip.feep.me
{{ .IP }}
$ fetch -qo- https://ip.feep.me
{{ .IP }}
$ bat -print=b https://ip.feep.me/ip
{{ .IP }}</pre>
{{ if .IsLookupCountryEnabled }}
<h2>Country lookup:</h2>
<pre>
$ http https://ip.feep.me/country
{{ .Country }}</pre>
{{ end }}
{{ if .IsLookupCityEnabled }}
<h2>City lookup:</h2>
<pre>
$ http https://ip.feep.me/city
{{ .City }}</pre>
{{ end }}
</div>
<div class="pure-u-1 pure-u-md-1-2">
<h2>JSON output:</h2>
<pre>
$ http https://ip.feep.me/json
{ {{ if .IsLookupCityEnabled }}
"city": "{{ .City }}",{{ end }}{{ if .IsLookupCountryEnabled }}
"country": "{{ .Country }}",{{ end }}{{ if .IsLookupAddrEnabled }}
"hostname": "{{ .Hostname }}",{{ end }}
"ip": "{{ .IP }}",
"ip_decimal": {{ .IPDecimal }}
}</pre>
<p>Setting the Accept header to application/json also works.</p>
<h2>Plain output:</h2>
<p>Always returns the IP address including a trailing newline, regardless of user agent.</p>
<pre>
$ http https://ip.feep.me/ip
{{ .IP }}</pre>
{{ if .IsLookupPortEnabled }}
<h2>Testing port connectivity:</h2>
<pre>
$ http https://ip.feep.me/port/8080
{
"ip": "{{ .IP }}",
"port": 8080,
"reachable": false
}</pre>
{{ end }}
</div>
</div>
</body>
</html>