From d79ccfc05a00c470def605f4e70bc69844d30d97 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Sat, 12 Feb 2022 19:48:05 +0000 Subject: [PATCH] Add comment on why grpc is on its own port, replace deprecated --- app.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app.go b/app.go index 4922fba8..126ed861 100644 --- a/app.go +++ b/app.go @@ -35,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" + "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/reflection" @@ -518,7 +519,7 @@ func (h *Headscale) Serve() error { grpcGatewayConn, err := grpc.Dial( h.cfg.UnixSocket, []grpc.DialOption{ - grpc.WithInsecure(), + grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithContextDialer(GrpcSocketDialer), }..., ) @@ -558,6 +559,13 @@ func (h *Headscale) Serve() error { // gRPC setup // + // We are sadly not able to run gRPC and HTTPS (2.0) on the same + // port because the connection mux does not support matching them + // since they are so similar. There is multiple issues open and we + // can revisit this if changes: + // https://github.com/soheilhy/cmux/issues/68 + // https://github.com/soheilhy/cmux/issues/91 + // If TLS has been enabled, set up the remote gRPC server if tlsConfig != nil { log.Info().Msgf("Enabling remote gRPC at %s", h.cfg.GRPCAddr)