Improve: using native http request

This commit is contained in:
Dreamacro
2018-06-14 01:00:58 +08:00
parent 6e2b9edb45
commit 47e038cf18
12 changed files with 169 additions and 96 deletions

View File

@ -2,7 +2,6 @@ package tunnel
import (
"fmt"
"io"
"strings"
"sync"
@ -110,8 +109,7 @@ func (t *Tunnel) handleConn(localConn C.ServerAdapter) {
}
defer remoConn.Close()
go io.Copy(localConn.Writer(), remoConn.Reader())
io.Copy(remoConn.Writer(), localConn.Reader())
localConn.Connect(remoConn)
}
func (t *Tunnel) match(addr *C.Addr) C.Proxy {