// ListenAndTransfer listens for connections on the provided Proxy.Network and
// Proxy.Addr, and proxies them to Proxy.UpstreamAddr and Proxy.UpstreamNetwork.
//
// If unable to start the listener on the given Proxy.Network and Proxy.Addr
// then non-nil error is returned.
//
// See Proxy.Transfer for more details.
ListenAndTransfer listens for connections on the provided Proxy.Network and
Proxy.Addr, and proxies them to Proxy.UpstreamAddr and Proxy.UpstreamNetwork.

If unable to start the listener on the given Proxy.Network and Proxy.Addr
then non-nil error is returned.

See Proxy.Transfer for more details.
// ListenAndTransfer listens for connections on the provided Proxy . Network and // Proxy . Addr and proxies them to Proxy . UpstreamAddr and Proxy . UpstreamNetwork . // // If unable to start the listener on the given Proxy . Network and Proxy . Addr // then non - nil error is returned . // // See Proxy . Transfer for more details .
func (p *Proxy) ListenAndTransfer() error {
	ln, err := net.Listen(p.Network, p.Addr)
	if err != nil {
		return fmt.Errorf("net listen: %w", err)
	}
	return p.Transfer(ln)
}
func ( p * Proxy ) ListenAndTransfer ( ) error { ln , err := net . Listen ( p . Network , p . Addr ) if err != nil { return fmt . Errorf ( " " , err ) } return p . Transfer ( ln ) }
ListenAndTransfer listens for connections on the provided Proxy.Network and
Proxy.Addr, and proxies them to Proxy.UpstreamAddr and Proxy.UpstreamNetwork.
ListenAndTransfer listens for connections on the provided Proxy . Network and Proxy . Addr and proxies them to Proxy . UpstreamAddr and Proxy . UpstreamNetwork .