{"templateId":"markdown","versions":[{"version":"v1","label":"1.x (archive)","link":"/docs/cli/v1/commands/proxy","default":false,"active":false,"folderId":"6f4800fc"},{"version":"v2","label":"2.x (current)","link":"/docs/cli/commands/proxy","default":true,"active":true,"folderId":"6f4800fc"}],"sharedDataIds":{"sidebar":"sidebar-docs-cli.sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Redocly CLI","type":"markdown"},"seo":{"title":"proxy","description":"OpenAPI-generated documentation tool with 24k+ stars on Github - make APIs your company's superpower.","siteUrl":"https://redocly.com","image":"/assets/redocly-card.f670aae34a39545a5ea633a540cb3a4a333a1f23bb2ed3c4a1b17a5fbcf0ac85.db81178d.png","lang":"en-US"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"proxy","__idx":0},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["proxy"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["proxy"]}," command captures live HTTP traffic through a reverse proxy into a HAR file, and optionally validates it against an OpenAPI description in real time."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Experimental"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This is an experimental feature."," ","Its behavior, command, flags, and output may change in future releases."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["proxy"]}," command supports OpenAPI 3.x descriptions only."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["proxy"]}," command:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Starts a reverse proxy that forwards every request to an upstream ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--target"]}," and records each request/response exchange into a HAR file."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Appends each exchange to a temporary file on disk as it is captured (nothing is held in memory), then assembles the final HAR document on shutdown."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["When ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--api"]}," is provided, validates each captured exchange live against the description using the same engine as ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/cli/commands/drift"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["drift"]}]},"; findings are printed as they happen and a full report is rendered on shutdown."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The resulting HAR file can be replayed through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["drift"]}," later."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Spec loading reuses ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@redocly/openapi-core"]},", schema validation reuses the bundled ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@redocly/ajv"]},", and the upstream client uses ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["undici"]}," (already shipped), so there are no extra runtime dependencies."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Clients must target the proxy directly; there is no forward/",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CONNECT"]}," mode and no inbound TLS termination."," ","The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["accept-encoding"]}," header is stripped from forwarded requests so captured bodies are stored decoded; binary response bodies are stored base64-encoded in the HAR."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Captured exchanges are streamed to a temporary file (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<har>.entries.tmp"]},") and assembled into the final HAR only on shutdown."," ","If the process is terminated before shutdown, the temporary file remains but the final HAR is not written."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"usage","__idx":1},"children":["Usage"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"redocly proxy --target <url> --har <path>\nredocly proxy --target <url> --har <path> --api <api>\nredocly proxy --target <url> --har <path> [--port=<number>] [--host=<string>]\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"options","__idx":2},"children":["Options"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Option"},"children":["Option"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--target"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["REQUIRED."]}," Upstream base URL to forward captured requests to."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--har"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["REQUIRED."]}," Path to the HAR file where captured traffic is written."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--port"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Port the proxy listens on (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]}," picks a free port). Default value is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["4040"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--host"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Host the proxy binds to. Default value is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["127.0.0.1"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--api"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["OpenAPI description file or folder to validate captured traffic against (live)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--format"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Output format for the validation report printed on shutdown.",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Possible values:"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pretty"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["json"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["csv"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sarif"]},". Default value is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pretty"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--match-mode"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Endpoint matching mode.",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Possible values:"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["strict-host"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["basepath"]},". Default value is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["strict-host"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--ignore-cookies"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ignore cookie-based checks. Default value is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--ignore-headers"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Comma-separated header names to skip in undocumented-header checks. A trailing ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["*"]}," matches by prefix, for example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-consumer-*"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--max-findings"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Maximum findings shown in pretty output. Default value is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["10"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--rules"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Comma-separated subset of built-in rules to run: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["undocumented-endpoint"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["schema-consistency"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["security-baseline"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["owasp-api-top10"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--config"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Specify the path to the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/cli/configuration"},"children":["configuration file"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--lint-config"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Specify the severity level for the configuration file.",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Possible values:"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["warn"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["off"]},". Default value is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["warn"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--help"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Display help."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["--version"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Display version number."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"examples","__idx":3},"children":["Examples"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"capture-only-no-validation","__idx":4},"children":["Capture only (no validation)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"redocly proxy --target https://api.example.com --har ./capture.har\n# point your client at http://127.0.0.1:4040, then press Ctrl+C to stop\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"capture-and-validate-live-against-a-description","__idx":5},"children":["Capture and validate live against a description"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"redocly proxy --target https://api.example.com --har ./capture.har --api ./openapi.yaml\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"replay-a-captured-har-through-drift","__idx":6},"children":["Replay a captured HAR through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["drift"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"redocly drift ./capture.har --api ./openapi.yaml\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"exit-codes","__idx":7},"children":["Exit codes"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]},": no error-level findings (or capture-only mode)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]},": error-level drift detected in captured traffic."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related-commands","__idx":8},"children":["Related commands"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/cli/commands/drift"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["drift"]}]}," replays a recorded HAR (or other traffic log) against an OpenAPI description."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/cli/commands/generate-spec"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["generate-spec"]}]}," infers an OpenAPI description from a captured HAR."]}]}]},"headings":[{"value":"proxy","id":"proxy","depth":1},{"value":"Usage","id":"usage","depth":2},{"value":"Options","id":"options","depth":2},{"value":"Examples","id":"examples","depth":2},{"value":"Capture only (no validation)","id":"capture-only-no-validation","depth":3},{"value":"Capture and validate live against a description","id":"capture-and-validate-live-against-a-description","depth":3},{"value":"Replay a captured HAR through drift","id":"replay-a-captured-har-through-drift","depth":3},{"value":"Exit codes","id":"exit-codes","depth":2},{"value":"Related commands","id":"related-commands","depth":2}],"frontmatter":{"seo":{"title":"proxy"}},"lastModified":"2026-07-21T09:36:41.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/cli/commands/proxy","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}