Protobuf Support
APXY can decode Protocol Buffer (Protobuf) encoded request and response bodies when you provide the corresponding .proto schema files. This makes it possible to inspect gRPC and other Protobuf-based API traffic in human-readable form.
CLI
Register a schema
# From a file
apxy tools protobuf add-schema \
--name "user-service" \
--file ./protos/user.proto
# From inline content
apxy tools protobuf add-schema \
--name "order-service" \
--content 'syntax = "proto3"; message Order { string id = 1; int32 amount = 2; }'| Flag | Default | Description |
|---|---|---|
--name | — | Schema name (required) |
--file | — | Path to a .proto file (mutually exclusive with --content) |
--content | — | Inline proto definition (mutually exclusive with --file) |
List registered schemas
apxy tools protobuf list-schemasRemove a schema
apxy tools protobuf remove-schema --id <schema-id>Decode a traffic record
Decode the Protobuf body of a captured request or response:
# Decode the request body
apxy tools protobuf decode --id <record-id> --scope request
# Decode the response body
apxy tools protobuf decode --id <record-id> --scope response| Flag | Default | Description |
|---|---|---|
--id | — | Traffic record ID (required) |
--scope | response | request or response |
Use Cases
Inspect gRPC traffic
Register your service protos and decode gRPC request/response bodies:
apxy tools protobuf add-schema --name "my-service" --file ./proto/service.proto
# Capture some gRPC traffic, then:
apxy tools protobuf decode --id <record-id> --scope responseDebug mobile app APIs
Many mobile apps use Protobuf for compact payloads. Register the schema and decode traffic to see what’s being sent:
apxy tools protobuf add-schema --name "mobile-api" --file ./proto/mobile.proto
apxy tools protobuf decode --id <record-id> --scope requestLast updated on