Dynamic Interceptors
APXY provides Dynamic Interceptors — a programmable system for matching traffic and applying transformations using a DSL (Domain-Specific Language). Unlike static mock rules, interceptors support conditional logic and can modify requests and responses on-the-fly.
Paid feature — requires a license with interceptor editing capability.
Web UI
Open Interceptors from the Modify group. The page provides:
- A form to create interceptors with Name, Match Expression (DSL syntax), Action dropdown (mock / modify / observe), and optional Transform fields for headers, status, body, and delay
- A list of active interceptors with enable/disable toggles
- Delete buttons for each interceptor
CLI
There is no apxy … subcommand for interceptors in the current CLI. Use the Web UI
(Modify → Interceptors) to create, list, enable, disable, and delete interceptors.
The UI talks to the same control API that other clients can call programmatically.
Related automation (mock, rewrite, script, breakpoint, filter, network) is covered in the CLI Reference.
Match Expression DSL
Match expressions filter traffic based on request/response properties:
host == api.example.com
path contains /api/v2/
method == POST
status >= 400
url matches .*\.json$
header:Content-Type contains jsonCombine with && (AND) and || (OR):
host == api.example.com && method == POST
path contains /users || path contains /accountsSpecial values: * or true match everything.
Actions
| Action | Description |
|---|---|
mock | Return a fake response without forwarding to the server |
modify | Forward to the server but alter the request or response |
observe | Forward normally and log the match (no transformation) |
Transform Options
When using mock or modify actions, you can specify transforms:
| Field | Description |
|---|---|
set_request_headers | Overwrite request headers |
set_response_headers | Overwrite response headers |
set_response_status | Override response status code |
set_response_body | Override response body |
add_request_headers | Add headers without overwriting |
remove_headers | Header names to remove |
delay_ms | Delay before responding |
Use Cases
Add debug headers to staging requests
Create an interceptor in the Web UI with Action set to modify, Match set to
host == staging.example.com, and add a request header transform such as
X-Debug-Proxy: true.
Log all POST requests
Create an interceptor with Action observe and Match method == POST so matching
requests are tagged without changing behavior.