Skip to content

Commit

Permalink
fix: imports
Browse files Browse the repository at this point in the history
Signed-off-by: QuentinN42 <[email protected]>
  • Loading branch information
QuentinN42 committed Nov 7, 2024
1 parent 30f7b36 commit 1b27f1f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/grpc/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"syscall"
"time"

"github.com/Escape-Technologies/repeater/pkg/logger"
"golang.org/x/sys/unix"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
Expand All @@ -34,10 +33,10 @@ func GetCon(url, proxyURL string) *grpc.ClientConn {
}

if strings.HasPrefix(url, "localhost") {
logger.Debug("Using insecure GRPC connection")
log.Printf("Using insecure GRPC connection")
opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials()))
} else {
logger.Debug("Using secure GRPC connection over TLS")
log.Printf("Using secure GRPC connection over TLS")
systemRoots, err := x509.SystemCertPool()
if err != nil {
log.Fatalf("Unable to load CA certificates: %v \n", err)
Expand All @@ -49,15 +48,15 @@ func GetCon(url, proxyURL string) *grpc.ClientConn {
}

if proxyURL != "" {
logger.Debug("Using custom proxy URL: %s", proxyURL)
log.Printf("Using custom proxy URL: %s", proxyURL)
opts = append(opts, grpc.WithContextDialer(proxyDialer(proxyURL)))
}

con, err := grpc.NewClient(url, opts...)
if err != nil {
log.Fatalf("Error connecting: %v \n", err)
}
logger.Debug("Connected to %s", url)
log.Printf("Connected to %s", url)
return con
}

Expand Down

0 comments on commit 1b27f1f

Please sign in to comment.