mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-05-18 10:39:09 +03:00
18 lines
350 B
Go
18 lines
350 B
Go
package cloudflare
|
|
|
|
import (
|
|
"context"
|
|
"net"
|
|
"net/http"
|
|
)
|
|
|
|
type CloudflareApiOption func(api *CloudflareApi)
|
|
|
|
func WithDialContext(dialContext func(ctx context.Context, network, addr string) (net.Conn, error)) CloudflareApiOption {
|
|
return func(api *CloudflareApi) {
|
|
api.client.Transport = &http.Transport{
|
|
DialContext: dialContext,
|
|
}
|
|
}
|
|
}
|