Skip to content

Commit 175cd29

Browse files
committed
fix: hang issue with multiple connections pages
1 parent fb7ddc3 commit 175cd29

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

middleman.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ import (
99

1010
// https://sosedoff.com/2015/05/25/ssh-port-forwarding-with-go.html
1111
func handleClient(client net.Conn, remote net.Conn) {
12-
defer client.Close()
13-
chDone := make(chan bool)
12+
//defer client.Close()
13+
//chDone := make(chan bool)
1414

1515
// Start remote -> local data transfer
1616
go func() {
1717
_, err := io.Copy(client, remote)
1818
if err != nil {
1919
log.Println(fmt.Sprintf("error while copy remote->local: %s", err))
2020
}
21-
chDone <- true
21+
//chDone <- true
2222
}()
2323

2424
// Start local -> remote data transfer
@@ -27,8 +27,7 @@ func handleClient(client net.Conn, remote net.Conn) {
2727
if err != nil {
2828
log.Println(fmt.Sprintf("error while copy local->remote: %s", err))
2929
}
30-
chDone <- true
30+
//chDone <- true
3131
}()
32-
33-
<-chDone
32+
//<-chDone
3433
}

0 commit comments

Comments
 (0)