SpoofDPI/proxy/handler/conn.go
xvzc 79d255719e
fix: packet processing for http request (#230)
* fix: http proxy

* chore: make a function for setting connection timeout

* chore: rename parameters for consistency
2024-09-03 16:07:11 +09:00

15 lines
236 B
Go

package handler
import (
"net"
"time"
)
func setConnectionTimeout(conn *net.TCPConn, timeout int) error {
if timeout <= 0 {
return nil
}
return conn.SetReadDeadline(time.Now().Add(time.Millisecond * time.Duration(timeout)))
}