Skip to Content
Hands-On Software Engineering with Golang
book

Hands-On Software Engineering with Golang

by Achilleas Anagnostopoulos
January 2020
Intermediate to advanced
640 pages
16h 56m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Golang

Security considerations for gRPC APIs

The constructor for each of the RPC clients that the protoc compiler generated for you expects a grpc.Connection argument. This is intentional as a single remote server might expose multiple RPC services. Given that HTTP/2 supports request multiplexing, it makes sense to instantiate a single connection to the server and share it between the various RPC clients.

So, how can we obtain a grpc.Connection instance? The grpc package provides a convenience helper called Dial, which handles all the low-level details for establishing a connection to a gRPC server. The Dial function expects the address of the gRPC server we want to connect to and a variadic list of grpc.DialOption values.

At this point, it is important ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Golang

Hands-On Software Architecture with Golang

Jyotiswarup Raiturkar

Publisher Resources

ISBN: 9781838554491Supplemental Content