增加稳定性

This commit is contained in:
wenyifan
2022-09-01 17:49:27 +08:00
parent 0b338de152
commit c695474f6b
2 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"github.com/xtaci/smux"
"io"
"net"
"time"
)
type Server struct {
@ -56,6 +57,10 @@ func handler(conn net.Conn, targetAddress string, fakeAddress string) {
<-waitCh
//Clean up previous buffered data
conn.SetDeadline(time.Now())
conn.SetDeadline(time.Time{})
//Process real tcp connection
session, err := smux.Server(conn, nil)
if err != nil {