+ {{ end }} {{ if .UserAgent }} {{ if .UserAgent.Comment }}
+
+
User Agent
+
{{ .UserAgent.Product }}/{{ .UserAgent.Version }}
+
+ {{ end }} {{ if .UserAgent.Comment }}
+
+
Comment
+
{{ .UserAgent.Comment }}
+
+ {{ end }} {{ if .UserAgent.RawValue }}
+
+
Raw Value
+
{{ .UserAgent.RawValue }}
+
+ {{ end }} {{ end }}
+
+
+ This information is provided from the GeoLite2 database created by
+ MaxMind, available from
+ www.maxmind.com
+
+
+ {{ if .City }}
+
+
Map
+
+
+ {{ end }}
+
+
+
+
+
How do I get this programmatically?
+
+ With the widget below you can build your query, and see what the
+ result will look like.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
You can open this page for another IP
+
+
+
+
+
+
Check Another IP
+
+
+
+
+
+
+
+
+
+ And you can check if a port on your IP is open
+
+
+
+
+
+
+
Check For Port
+
+
+
+
+
+
+
+
+
FAQ
+
How do I force IPv4 or IPv6 lookup?
+
+ As of 2018-07-25 it's no longer possible to force protocol using
+ the
+ v4 and v6 subdomains. IPv4 or IPv6 still can be
+ forced by passing the appropiate flag to your client, e.g
+ curl -4 or curl -6.
+
+
Can I force getting JSON?
+
+ Setting the Accept: application/json header works as
+ expected.
+
+
+
Is automated use of this service permitted?
+
+ Yes, as long as the rate limit is respected. The rate limit is in
+ place to ensure a fair service for all.
+
+
+ Please limit automated requests to 1 request per minute.
+ No guarantee is made for requests that exceed this limit. They may
+ be rate-limited, with a 429 status code, or dropped entirely.
+
+
+
Can I run my own service?
+
+ Yes, the source code and documentation is available on
+ GitHub.
+
+
+
+
+
+
+
diff --git a/html/leafcloud-logo.svg b/html/leafcloud-logo.svg
new file mode 100644
index 0000000..9e9f4a7
--- /dev/null
+++ b/html/leafcloud-logo.svg
@@ -0,0 +1,13 @@
+
\ No newline at end of file
diff --git a/html/script.html b/html/script.html
new file mode 100644
index 0000000..0d98614
--- /dev/null
+++ b/html/script.html
@@ -0,0 +1,105 @@
+
diff --git a/html/styles.html b/html/styles.html
new file mode 100644
index 0000000..a616aea
--- /dev/null
+++ b/html/styles.html
@@ -0,0 +1,199 @@
+
diff --git a/http/http.go b/http/http.go
index 9545dc1..83c7f5d 100644
--- a/http/http.go
+++ b/http/http.go
@@ -321,7 +321,7 @@ func (s *Server) DefaultHandler(w http.ResponseWriter, r *http.Request) *appErro
if err != nil {
return internalServerError(err)
}
- t, err := template.ParseFiles(s.Template)
+ t, err := template.ParseGlob(s.Template + "/*")
if err != nil {
return internalServerError(err)
}
@@ -329,6 +329,7 @@ func (s *Server) DefaultHandler(w http.ResponseWriter, r *http.Request) *appErro
if err != nil {
return internalServerError(err)
}
+
var data = struct {
Response
Host string
diff --git a/index.html b/index.html
deleted file mode 100644
index 8256fcd..0000000
--- a/index.html
+++ /dev/null
@@ -1,197 +0,0 @@
-
-
-
-
- What is my IP address? — {{ .Host }}
-
-
-
-
-
-
-
-
-
As of 2018-07-25 it's no longer possible to force protocol using
- the v4 and v6 subdomains. IPv4 or IPv6 still can be forced
- by passing the appropiate flag to your client, e.g curl -4
- or curl -6.
-
-
Is automated use of this service permitted?
-
- Yes, as long as the rate limit is respected. The rate limit is in
- place to ensure a fair service for all.
-
-
- Please limit automated requests to 1 request per minute. No
- guarantee is made for requests that exceed this limit. They may be
- rate-limited, with a 429 status code, or dropped entirely.
-
-
-
Can I run my own service?
-
Yes, the source code and documentation is available on GitHub.