func GetRemoteAddr(r *http.Request) (string, string) {
	addr := r.RemoteAddr
	if addr == "" || !strings.Contains(addr, ":") {
		return "", ""
	}
	addrSlice := strings.Split(addr, ":")
	return addrSlice[0], addrSlice[1]
}
GetRemoteAddr returns network address that sent the request
package httputil
import (
	"net/http"
	"strings"
)
func GetRequestAddr(r *http.Request) (string, string) {
	if r == nil || r.Host == "" || r.URL == nil {
		return "", ""
	}
	hostSlice := strings.Split(r.Host, ":")
	switch len(hostSlice) {
	case 2:
		return hostSlice[0], hostSlice[1]
	default:
		return hostSlice[0], GetPortByScheme(r.URL.Scheme)
	}
}
func GetRequestHost(r *http.Request) string {
	host, _ := GetRequestAddr(r)
	return host
}
func GetRequestPort(r *http.Request) string {
	_, port := GetRequestAddr(r)
	return port
}