增加稳定性
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user