mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2024-12-22 22:36:53 +00:00
79d255719e
* fix: http proxy * chore: make a function for setting connection timeout * chore: rename parameters for consistency
15 lines
236 B
Go
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)))
|
|
}
|