Fix Ctrl-C handling
This commit is contained in:
@@ -37,7 +37,9 @@ func (d *Deconnector) handleTunnel(clientConn net.Conn, host string, upstreamURL
|
||||
fmt.Fprintf(clientConn, "HTTP/1.1 200 Connection established\r\n\r\n")
|
||||
|
||||
done := make(chan struct{}, 2)
|
||||
|
||||
go func() { io.Copy(upstreamConn, clientConn); done <- struct{}{} }()
|
||||
go func() { io.Copy(clientConn, upstreamConn); done <- struct{}{} }()
|
||||
|
||||
<-done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user