func (conn *PacketConn) ReadFrom(p []byte) (int, net.Addr, error) {
	hp := make([]byte, 512+len(p))
	n, orig, origErr := conn.PacketConn.ReadFrom(hp)
	if n > 0 {
		b := bytes.NewBuffer(hp[:n])
		pp := newProxyParser(b)
		err := pp.parseProxyProtoOnce()
		if err != nil {
			return 0, orig, err
		}
		n = copy(p, b.Bytes())
		return n, &Addr{
			Addr:       orig,
			remoteAddr: pp.remoteAddr(orig),
		}, origErr
	}
	return n, orig, origErr
}
// ReadFrom implements net.PacketConn
//
// It will parse PROXY header first, then copies the actual data into p.  On
// successful parse, the returned address will be of type *Addr
ReadFrom implements net.PacketConn

It will parse PROXY header first, then copies the actual data into p.  On
successful parse, the returned address will be of type *Addr
// ReadFrom implements net . PacketConn // // It will parse PROXY header first then copies the actual data into p . On // successful parse the returned address will be of type * Addr
func (conn *PacketConn) ReadFrom(p []byte) (int, net.Addr, error) {
	hp := make([]byte, 512+len(p))
	n, orig, origErr := conn.PacketConn.ReadFrom(hp)
	if n > 0 {
		b := bytes.NewBuffer(hp[:n])
		pp := newProxyParser(b)
		err := pp.parseProxyProtoOnce()
		if err != nil {
			return 0, orig, err
		}
		n = copy(p, b.Bytes())
		return n, &Addr{
			Addr:       orig,
			remoteAddr: pp.remoteAddr(orig),
		}, origErr
	}
	return n, orig, origErr
}
func ( conn * PacketConn ) ReadFrom ( p [ ] byte ) ( int , net . Addr , error ) { hp := make ( [ ] byte , 512 + len ( p ) ) n , orig , origErr := conn . PacketConn . ReadFrom ( hp ) if n > 0 { b := bytes . NewBuffer ( hp [ : n ] ) pp := newProxyParser ( b ) err := pp . parseProxyProtoOnce ( ) if err != nil { return 0 , orig , err } n = copy ( p , b . Bytes ( ) ) return n , & Addr { Addr : orig , remoteAddr : pp . remoteAddr ( orig ) , } , origErr } return n , orig , origErr }
ReadFrom implements net.PacketConn
ReadFrom implements net . PacketConn