Exemplo n.º 1
0
func getRealHost(w http.ResponseWriter, r *http.Request) string {
	ip, _, _ := net.SplitHostPort(r.RemoteAddr)
	w.RemoteAddr = r.Header.Get("X-FORWARDED-FOR")
	if w.RemoteAddr != nil {
		return w.RemoteAddr
	}
	return nil
}