Can I have a mixture of connect-go and protoc-go running at the same time? #501
-
Hi, grpcServer := grpc.NewServer()
mux := http.NewServerMux()
// protoc service
pb.RegisterNormalGRPCService1(grpcServer, myService)
// connect-go
path, handler := connect.NewBufAPIHander(myService)
mux.Handle(path, handler)
http.Server {
Handler : h2c.NewHandler(mux, &http2.Server{})
}.ListenAndServe() If I setup my server like this and run, I can hit the connect-go endpoint okay but when I use protoc client to send gRPC requests NormalGRPCServiceClient.MyAPI(request) I got rpc error: code = Unimplemented desc = unexpected HTTP status code received from server: 404 (Not Found); transport: received unexpected content-type "text/plain; charset=utf-8" |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi! Sorry for the late reply, @user3301. You can have both Of course, |
Beta Was this translation helpful? Give feedback.
Hi! Sorry for the late reply, @user3301.
You can have both
grpc-go
andconnect-go
running side-by-side, but typically they'll be on separate ports. In your pseudocode above, you never callgrpcServer.Serve
.Of course,
connect-go
supports the gRPC protocol, so you don't needgrpc-go
:)