mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-06-02 17:27:32 +03:00
Added WARP endpoint
This commit is contained in:
17
common/cloudflare/option.go
Normal file
17
common/cloudflare/option.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package cloudflare
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type CloudflareApiOption func(api *CloudeflareApi)
|
||||
|
||||
func WithDialContext(dialContext func(ctx context.Context, network, addr string) (net.Conn, error)) CloudflareApiOption {
|
||||
return func(api *CloudeflareApi) {
|
||||
api.client.Transport = &http.Transport{
|
||||
DialContext: dialContext,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user