优化连接效率
This commit is contained in:
@@ -1,7 +1 @@
|
||||
FWD_PORT=20001
|
||||
|
||||
FRP_HOST=127.0.0.1
|
||||
FRP_CTRL_PORT=18080
|
||||
FRP_DATA_PORT=18081
|
||||
|
||||
RETRY_INTERVAL=3
|
||||
FWD_HOST=127.0.0.1
|
||||
|
||||
25
cmd/testClient/main.go
Normal file
25
cmd/testClient/main.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
ls, _ := net.Listen("tcp", ":8081")
|
||||
for {
|
||||
src, _ := ls.Accept()
|
||||
go func() {
|
||||
dst, _ := net.Dial("tcp", ":8080")
|
||||
go func() {
|
||||
defer dst.Close()
|
||||
io.Copy(dst, src)
|
||||
}()
|
||||
go func() {
|
||||
defer src.Close()
|
||||
io.Copy(src, dst)
|
||||
}()
|
||||
}()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user