mirror of
https://gitee.com/konyshe/goodlink.git
synced 2025-12-24 08:13:00 +08:00
improve the data transmission speed
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"goodlink/pool"
|
||||
"io"
|
||||
"net"
|
||||
|
||||
@@ -9,25 +8,19 @@ import (
|
||||
)
|
||||
|
||||
func ForwardT2Q(tc net.Conn, qc quic.Stream, stun_quic_conn quic.Connection) {
|
||||
buf := pool.Malloc(1500)
|
||||
|
||||
defer func() {
|
||||
pool.Free(buf)
|
||||
qc.Close()
|
||||
tc.Close()
|
||||
}()
|
||||
|
||||
io.CopyBuffer(tc, qc, buf)
|
||||
io.Copy(tc, qc)
|
||||
}
|
||||
|
||||
func ForwardQ2T(qc quic.Stream, tc net.Conn, stun_quic_conn quic.Connection) {
|
||||
buf := pool.Malloc(1500)
|
||||
|
||||
defer func() {
|
||||
pool.Free(buf)
|
||||
qc.Close()
|
||||
tc.Close()
|
||||
}()
|
||||
|
||||
io.CopyBuffer(qc, tc, buf)
|
||||
io.Copy(qc, tc)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package proxy
|
||||
import (
|
||||
"context"
|
||||
"encoding/binary"
|
||||
pool2 "goodlink/pool"
|
||||
"goodlink/pool2"
|
||||
"goodlink/socks5"
|
||||
"goodlink/utils"
|
||||
"io"
|
||||
|
||||
Reference in New Issue
Block a user