diff --git a/net/conn.go b/net/conn.go index ad23326..64f1376 100644 --- a/net/conn.go +++ b/net/conn.go @@ -2,6 +2,7 @@ package net import ( "net" + "time" log "github.com/sirupsen/logrus" "github.com/xvzc/SpoofDPI/doh" @@ -56,6 +57,8 @@ func (conn *Conn) ReadBytes() ([]byte, error) { ret := make([]byte, 0) buf := make([]byte, BUF_SIZE) + conn.conn.SetReadDeadline(time.Now().Add(3 * time.Second)) + for { n, err := conn.Read(buf) if err != nil {