diff options
author | terminaldweller <thabogre@gmail.com> | 2023-01-30 17:12:54 +0000 |
---|---|---|
committer | terminaldweller <thabogre@gmail.com> | 2023-01-30 17:12:54 +0000 |
commit | 15f245763ba7b412e6dbe16e6768f40a789067f2 (patch) | |
tree | c7b503d0e236df68cb0261b628d6c9433ca7ad47 /icanhazallips.go | |
parent | fixed the common name for the self-signed cert (diff) | |
download | icanhazallips-15f245763ba7b412e6dbe16e6768f40a789067f2.tar.gz icanhazallips-15f245763ba7b412e6dbe16e6768f40a789067f2.zip |
added a readme
Diffstat (limited to '')
-rw-r--r-- | icanhazallips.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/icanhazallips.go b/icanhazallips.go index 218063c..68a2f82 100644 --- a/icanhazallips.go +++ b/icanhazallips.go @@ -3,6 +3,7 @@ package main import ( "errors" + "fmt" "log" "net" "net/http" @@ -13,6 +14,8 @@ func getIP(r *http.Request) (string, error) { ips := r.Header.Get("X-Forwarded-For") splitIps := strings.Split(ips, ",") + fmt.Println(r.RemoteAddr) + if len(splitIps) > 0 { netIP := net.ParseIP(splitIps[len(splitIps)-1]) if netIP != nil { |