Feature/exit nodes - Windows and macOS support (#1726)

This commit is contained in:
Viktor Liu
2024-04-03 11:11:46 +02:00
committed by GitHub
parent 9af532fe71
commit 7938295190
41 changed files with 2254 additions and 965 deletions
@@ -1,11 +1,10 @@
//go:build !android
package grpc
import (
"context"
"net"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc"
nbnet "github.com/netbirdio/netbird/util/net"
@@ -13,6 +12,11 @@ import (
func WithCustomDialer() grpc.DialOption {
return grpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn, error) {
return nbnet.NewDialer().DialContext(ctx, "tcp", addr)
conn, err := nbnet.NewDialer().DialContext(ctx, "tcp", addr)
if err != nil {
log.Errorf("Failed to dial: %s", err)
return nil, err
}
return conn, nil
})
}
-9
View File
@@ -1,9 +0,0 @@
//go:build !linux || android
package grpc
import "google.golang.org/grpc"
func WithCustomDialer() grpc.DialOption {
return grpc.EmptyDialOption{}
}