New Transparent capture is in preview. Record every app's traffic with no proxy configuration, on Windows, macOS and Linux. Learn more

protobufRequestFilter Filter

Select exchanges whose request body is protobuf, detected from the request Content-Type header before any action runs on the upstream side.

protobufRequestFilter is the precise selector for inbound protobuf traffic in a Fluxzy rule. Combine it with the request side actions you already use for JSON or form encoded uploads to extend the same observability and shaping workflow to binary clients.

When to use this filter

Use protobufRequestFilter when you want a rule that fires only because the client is sending protobuf, irrespective of what the server returns. This is the right filter when you intend to inspect, log or mutate the upload side of an API.

Typical situations:

  • Auditing every protobuf upload (gRPC unary or client streaming) for size and frequency.
  • Throttling clients that POST large protobuf payloads while leaving the response side untouched.
  • Routing inbound protobuf calls to a dedicated capture for later schema replay.

The filter evaluates on the requestBodyReceivedFromClient scope, so the upload Content-Type has already been read by the proxy when it runs. If you also care about responses use protobufFilter, or protobufResponseFilter for the opposite direction only.

Real world examples

Tag every protobuf upload

Add a tag to any exchange where the client is sending protobuf so you can pivot the timeline by inbound encoding.

rules:
- filter:
    typeKind: ProtobufRequestFilter
  actions:
  - typeKind: ApplyTagAction
    tag:
      value: protobuf-upload

Throttle protobuf uploads to simulate a slow client

Restrict the bandwidth of any request that carries a protobuf body so you can reproduce timeouts on the server side.

rules:
- filter:
    typeKind: ProtobufRequestFilter
  actions:
  - typeKind: AverageThrottleAction
    bandwidthBytesPerSeconds: 16384

Capture only inbound protobuf exchanges

Send protobuf uploads to a dedicated capture so the binary payloads can be replayed later against a known .proto schema.

rules:
- filter:
    typeKind: ProtobufRequestFilter
  actions:
  - typeKind: CaptureSessionAction

Reference

protobufRequestFilter

Description

Select requests sending a protobuf body. Filtering is made by inspecting value of Content-Type header.

Evaluation scope

Evaluation scope defines the timing where this filter will be applied.

requestBodyReceivedFromClient This scope occurs the moment fluxzy received fully the request body from the client. In a fullstreaming mode which is the default mode, this event occurs when the full body is already fully sent to the remote server.

YAML configuration name

protobufRequestFilter

Settings

This filter has no specific characteristic

The following table describes the customizable properties available for this filter:

Property Type Description DefaultValue
inverted boolean Negate the filter result false

Example of usage

The following examples apply a comment to the filtered exchange

Select only exchanges with protobuf request body.

rules:
- filter:
    typeKind: ProtobufRequestFilter
  actions:
  - typeKind: ApplyCommentAction
    comment: filter was applied

Select exchanges without protobuf request body.

rules:
- filter:
    typeKind: ProtobufRequestFilter
  actions:
  - typeKind: ApplyCommentAction
    comment: filter was applied

.NET reference

View definition of ProtobufRequestFilter for .NET integration.

See also

This filter has no related filter

Frequently asked questions

How is protobufRequestFilter different from protobufFilter?

protobufRequestFilter only inspects the request Content-Type, while protobufFilter matches when either the request or the response is protobuf. Use the request filter when you only want to act on the upload side.

Does it match gRPC traffic?

Yes. gRPC uses application/grpc, which is a protobuf media type, so client streaming and unary gRPC requests are matched too.

When does the filter fire in the pipeline?

It evaluates on the requestBodyReceivedFromClient scope, after the proxy has finished reading the request body from the client. This is the right moment to act on the upload.

Can I exclude protobuf uploads?

Yes, set inverted: true to select every exchange whose request body is not protobuf.

Learn more about Fluxzy rules