func (p *Proxy) tcpPacketLoop(l net.Listener, proto string) {
	log.Printf("Entering the %s listener loop on %s", proto, l.Addr())
	for {
		clientConn, err := l.Accept()

		if err != nil {
			if isConnClosed(err) {
				log.Printf("tcpListen.Accept() returned because we're reading from a closed connection, exiting loop")
				break
			}
			log.Printf("got error when reading from TCP listen: %s", err)
		} else {
			go p.handleTCPConnection(clientConn, proto)
		}
	}
}
// tcpPacketLoop listens for incoming TCP packets
// proto is either "tcp" or "tls"
tcpPacketLoop listens for incoming TCP packets
proto is either "tcp" or "tls"
// tcpPacketLoop listens for incoming TCP packets // proto is either " tcp " or " tls "
func (p *Proxy) tcpPacketLoop(l net.Listener, proto string) {
	log.Printf("Entering the %s listener loop on %s", proto, l.Addr())
	for {
		clientConn, err := l.Accept()
		if err != nil {
			if isConnClosed(err) {
				log.Printf("tcpListen.Accept() returned because we're reading from a closed connection, exiting loop")
				break
			}
			log.Printf("got error when reading from TCP listen: %s", err)
		} else {
			go p.handleTCPConnection(clientConn, proto)
		}
	}
}
func ( p * Proxy ) tcpPacketLoop ( l net . Listener , proto string ) { log . Printf ( " " , proto , l . Addr ( ) ) for { clientConn , err := l . Accept ( ) if err != nil { if isConnClosed ( err ) { log . Printf ( " " ) break } log . Printf ( " " , err ) } else { go p . handleTCPConnection ( clientConn , proto ) } } }
tcpPacketLoop listens for incoming TCP packets
proto is either "tcp" or "tls"
tcpPacketLoop listens for incoming TCP packets proto is either " tcp " or " tls "