mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 16:26:38 +00:00
remove scheme information from management address when connecting via grpc
This commit is contained in:
@@ -78,7 +78,11 @@ func (s *Server) ListenAndServe(ctx context.Context, addr string) (err error) {
|
|||||||
|
|
||||||
// The very first thing to do should be to connect to the Management server.
|
// The very first thing to do should be to connect to the Management server.
|
||||||
// Without this connection, the Proxy cannot do anything.
|
// Without this connection, the Proxy cannot do anything.
|
||||||
s.mgmtConn, err = grpc.NewClient(s.ManagementAddress,
|
mgmtURL, err := url.Parse(s.ManagementAddress)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("parse management address: %w", err)
|
||||||
|
}
|
||||||
|
s.mgmtConn, err = grpc.NewClient(mgmtURL.Host,
|
||||||
grpc.WithTransportCredentials(insecure.NewCredentials()), // TODO: TLS needed here.
|
grpc.WithTransportCredentials(insecure.NewCredentials()), // TODO: TLS needed here.
|
||||||
grpc.WithKeepaliveParams(keepalive.ClientParameters{
|
grpc.WithKeepaliveParams(keepalive.ClientParameters{
|
||||||
Time: 20 * time.Second,
|
Time: 20 * time.Second,
|
||||||
|
|||||||
Reference in New Issue
Block a user