Telerik blogs

gRPC is growing in popularity due to its numerous benefits. Learn more about the framework and how to capture and inspect gRPC traffic with Fiddler Everywhere!

What is gRPC?

The initialism “gRPC” is around us more and more often each day. We are hearing that large companies like Google use gRPC (this is to be expected as “gRPC” stands for “Google Remote Procedure Calls”), plus others like Netflix, Spotify, Salesforce, IBM, Cisco, Dropbox and Slack—the list goes on and on.

So what exactly is gRPC, and how does it help developers today?

Technically, gRPC is a Remote Procedure Call (RPC) framework that can run in any environment. It can also be referred to as an architectural style similar to REST, SOAP, WebSockets, etc. While most applications in the wild still rely primarily on REST, it became apparent that the REST API is far from perfect, and relying only on it could be problematic as your business grows. The mass adoption of the microservices architecture style also showed the need for a different technology to solve various problems.

This is where gRPC came in! The gRPC framework is efficient, has high performance (some say up to seven times faster than REST), is cross-platform, has a native code compiler, and is ideal for microservices and data streaming. gRPC is not here to replace REST but should be considered an alternative for solving specific problems.

Looking into the framework itself, the first thing that we can notice is that it uses the Protobuf format (instead of JSON or XML). The pros of the format are that it is light and compressed (here is where the gRPC gains high performance). The cons are that Protocol Buffers messages are not human-readable.

Fiddler Everywhere from Progress Telerik can help developers who own the .proto file—each Protobuf message is available with Fiddler and can be used for deep-dive investigation.

gRPC Support in Fiddler Everywhere

As gRPC gained popularity, it became apparent that developers needed a debugging tool to help them capture and inspect gRPC traffic. The tool had to support HTTP/2 (because gRPC is based on HTTP/2 and is not compatible with HTTP/1.1) and also has to be ready to visualize the information from specific gRPC channels, including a handshake, messages, trailer headers, etc. Wait no more ...

Fiddler Everywhere to the rescue!

The Fiddler Everywhere ninja to the resque

After the Fiddler team recently introduced support for HTTP/2 and TLS 1.3, it was natural to go ahead with the implementation for gRPC support. With Fiddler Everywhere version 4.2.0 and above, gRPC support is a reality, and you can start capturing and inspecting its traffic out of the box. OK, not precisely out of the box—because the gRPC API relays on HTTP/2, you must ensure that your Fiddler Everywhere application has HTTP/2 capturing enabled through Settings > Connections > Enable HTTP/2 Support (BETA).

That’s all you need from Fiddler Everywhere’s side!

The next step is to tell your gRPC client application to respect Fiddler’s proxy for its HTTP and HTTPS requests. The specific proxy configuration entirely depends on the used client’s application technology (for example, different approaches if it is a Python app, a GO app, a Java app and so on). Learn more on how to set Fiddler Everywhere as a proxy for your technology here.

gRPC Inspection

Upon capturing a gRPC session, Fiddler Everywhere shows opened and closed gRPC channels in the Live Traffic list. A green badge in the ID column (by default, the first column on the left) indicates an active gRPC channel, while a red badge indicates that the gRPC channel is closed. Fiddler Everywhere supports all gRPC lifecycles and will successfully capture unary RPC, client streaming RPC, server streaming RPC and bidirectional streaming RPC.

Captured gRPC sessions in the Live Traffic list of Fiddler

You can select a session with a single click to observe the Handshake tab and its details. The Handshake tab contains information about the used HTTP headers and the specific gRPC trailers. The server sends trailers to the client after processing the request. A typical scenario is for trailers to contain information common to service methods.

Inspecting gRPC session through the Handshake tab

You can open the Messages tab by double-clicking on the selected session (or by manually selecting the tab) and inspect each streamed message in the gRPC channel. Each gRPC message uses the Protobuf format, which is in unreadable form and received as binary.

You can inspect the binary message from the Message inspector. Fiddler Everywhere also provides instruments (Decode value and HEX inspector) to partially visualize text content that could be part of the Protobuf message. It is important to note that this will always be the raw Protobuf content that was captured over the wire, not the decoded values of the message fields. Only the creator and owner of the .proto scheme can fully decode a Protobuf message. In a future release, we will be adding the possibility for providing a .proto schema to Fiddler Everywhere for automatically decoding the Protobuf messages.

Inspecting gRPC session through the Messages tab

Wrap-up

gRPC is here to stay—in 2022, the technology gained popularity and increased its spread (from 8% to 11% percent of developers who said they like gRPC). It is now one of the most recognizable architectural styles alongside REST, WebSocket, SOAP, Webhooks and GraphQL. It is likely that a programmer will have to deal with it sooner or later, and Fiddler solves that potential puzzle.

Fiddler Everywhere itself evolves more after each release and is far from being just a forward proxy or a web debugging tool. The added gRPC support, alongside the support for other modern technologies like HTTP/2, TLS 1.3, the advanced Rules capabilities, HTTP Request composer, collaboration and many more, make Fiddler a Swiss Army knife for solving a different range of tasks.

For QA engineers and developers, support personas, web administrators, policy enforcers and security experts, Fiddler is a tool that can bring much value. Did we mention that Fiddler is cross-platform? Yes, it works on macOS, Windows and Linux and can capture traffic from virtually any client that uses the HTTP(S) protocol.

In case you have just heard about us—the team welcomes you! Go ahead and try Fiddler Everywhere and let us know what you think!


Nikolay Iliev
About the Author

Nikolay Iliev

Nikolay Iliev is a senior technical support engineer and, as such, is a part of the Fiddler family. He joined the support team in 2016 and has been striving to deliver customer satisfaction ever since. Nick usually rests with a console game or a sci-fi book.

Related Posts

Comments

Comments are disabled in preview mode.