[Go] Embed gRPC server as http.Handler in existing server?

118 views
Skip to first unread message

Scott Devoid

unread,
Aug 25, 2016, 12:36:45 PM8/25/16
to grpc.io
Hi all,

I was wondering if it would be possible / reasonable to embed my
grpc.Server instance in an existing http.Server, i.e. as a
http.Handler? If so, which paths should I avoid to ensure that a gRPC
client's request route to the gRPC server?

Alternatively, is it possible to add a plain-old http.Handler /
http.Server at a specific subpath in gRPC's existing server? The point
of this is that I'd like to add Go's net/http/pprof profile and
debugging endpoints to the same port I'm listening on for gRPC
requests.

Thanks!
~ Scott

zel...@gmail.com

unread,
Aug 31, 2016, 10:58:12 AM8/31/16
to grpc.io
I know the CockroachDB folks have experience sharing ports: https://www.cockroachlabs.com/blog/a-tale-of-two-ports/
Reply all
Reply to author
Forward
0 new messages