mirror of
https://github.com/fumiama/terasu.git
synced 2026-06-10 21:24:46 +08:00
feat: add plugin
This commit is contained in:
22
dialer/dialer.go
Normal file
22
dialer/dialer.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package dialer
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
// DefaultDialer is the default dialer used for establishing TCP connections
|
||||
var DefaultDialer = net.Dialer{
|
||||
Timeout: 4 * time.Second,
|
||||
}
|
||||
|
||||
// SetDefaultTimeout sets the default timeout for all HTTP2 client connections
|
||||
func SetDefaultTimeout(t time.Duration) {
|
||||
DefaultDialer.Timeout = t
|
||||
}
|
||||
|
||||
// SetDefaultControl sets control of the default dailer
|
||||
func SetDefaultControl(c func(network string, address string, c syscall.RawConn) error) {
|
||||
DefaultDialer.Control = c
|
||||
}
|
||||
Reference in New Issue
Block a user