mirror of
https://github.com/fumiama/terasu.git
synced 2026-06-12 14:10:32 +08:00
feat: add plugin
This commit is contained in:
19
dns/tls.go
Normal file
19
dns/tls.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package dns
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"net"
|
||||
|
||||
mtls "github.com/fumiama/terasu/tls"
|
||||
)
|
||||
|
||||
// DialTLSContext fills http.Transport method with terasu and DNS
|
||||
func DialTLSContext(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||
return DialTLSContextWithConfig(ctx, network, addr, nil)
|
||||
}
|
||||
|
||||
// DialTLSContextWithConfig fills http2.Transport method with terasu and DNS
|
||||
func DialTLSContextWithConfig(ctx context.Context, network, addr string, cfg *tls.Config) (net.Conn, error) {
|
||||
return mtls.DialTLSContextCL(ctx, network, addr, cfg, nil)
|
||||
}
|
||||
Reference in New Issue
Block a user