mirror of
https://github.com/netbirdio/netbird.git
synced 2025-03-05 02:11:13 +01:00
19 lines
335 B
Go
19 lines
335 B
Go
|
//go:build !android
|
||
|
|
||
|
package grpc
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"net"
|
||
|
|
||
|
"google.golang.org/grpc"
|
||
|
|
||
|
nbnet "github.com/netbirdio/netbird/util/net"
|
||
|
)
|
||
|
|
||
|
func WithCustomDialer() grpc.DialOption {
|
||
|
return grpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn, error) {
|
||
|
return nbnet.NewDialer().DialContext(ctx, "tcp", addr)
|
||
|
})
|
||
|
}
|