improve the data transmission speed

This commit is contained in:
kony
2025-04-17 15:15:22 +08:00
parent a66d4131dd
commit 5f550438dc
10 changed files with 25 additions and 26 deletions

View File

@@ -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)
}

View File

@@ -3,7 +3,7 @@ package proxy
import (
"context"
"encoding/binary"
pool2 "goodlink/pool"
"goodlink/pool2"
"goodlink/socks5"
"goodlink/utils"
"io"