1
0
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:
源文雨
2026-02-16 15:20:45 +08:00
parent f6d5336492
commit 1d573cf2be
14 changed files with 234 additions and 295 deletions

22
dialer/dialer.go Normal file
View 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
}