func (conn *Conn) RemoteAddr() net.Addr {
	orig := conn.Conn.RemoteAddr()
	if err := conn.proxyParser.parseProxyProtoOnce(); err != nil {
		return orig
	}
	if conn.proxyParser.SrcIP != nil {
		switch orig.(type) {
		case *net.TCPAddr:
			return &net.TCPAddr{
				IP:   conn.proxyParser.SrcIP,
				Port: conn.proxyParser.SrcPort,
			}
		case *net.UDPAddr:
			return &net.UDPAddr{
				IP:   conn.proxyParser.SrcIP,
				Port: conn.proxyParser.SrcPort,
			}
		}
	}
	return orig
}
// RemoteAddr returns remote address as conveyed in the PROXY header
RemoteAddr returns remote address as conveyed in the PROXY header
// RemoteAddr returns remote address as conveyed in the PROXY header
func (conn *Conn) RemoteAddr() net.Addr {
	orig := conn.Conn.RemoteAddr()
	if err := conn.proxyParser.parseProxyProtoOnce(); err != nil {
		return orig
	}
	if conn.proxyParser.SrcIP != nil {
		switch orig.(type) {
		case *net.TCPAddr:
			return &net.TCPAddr{
				IP:   conn.proxyParser.SrcIP,
				Port: conn.proxyParser.SrcPort,
			}
		case *net.UDPAddr:
			return &net.UDPAddr{
				IP:   conn.proxyParser.SrcIP,
				Port: conn.proxyParser.SrcPort,
			}
		}
	}
	return orig
}
func ( conn * Conn ) RemoteAddr ( ) net . Addr { orig := conn . Conn . RemoteAddr ( ) if err := conn . proxyParser . parseProxyProtoOnce ( ) ; err != nil { return orig } if conn . proxyParser . SrcIP != nil { switch orig . ( type ) { case * net . TCPAddr : return & net . TCPAddr { IP : conn . proxyParser . SrcIP , Port : conn . proxyParser . SrcPort , } case * net . UDPAddr : return & net . UDPAddr { IP : conn . proxyParser . SrcIP , Port : conn . proxyParser . SrcPort , } } } return orig }
RemoteAddr returns remote address as conveyed in the PROXY header
RemoteAddr returns remote address as conveyed in the PROXY header