Skip to main content

Replay remote curl requests locally

Project description

localcurl

A tool to replay remote curl requests locally for easier debugging and testing.

Why use localcurl?

When debugging API issues or developing locally against a remote service, you often need to replay real requests from production or staging environments. localcurl makes it easy by automatically rewriting curl commands to point to your local service while preserving all headers, authentication, and other parameters.

Installation

pip install localcurl

NB: supports Python 3.8+

Usage

localcurl http://localhost:8080 curl https://api.example.com/endpoint

Or, as a shorthand:

lc http://localhost:8080 curl https://api.example.com/endpoint

The curl command can also be piped from stdin:

echo 'curl https://api.example.com/endpoint' | localcurl http://localhost:8080

Or read from the clipboard:

localcurl http://localhost:8080

Options

  • addrport: The local address to send the request to (e.g., http://localhost:8080)
  • --no-verify: Disable server TLS certificate verification
  • --keep-host-cookie-prefix: Prevent stripping __Host- prefix from cookies
  • curl_command: The curl command to parse (reads from stdin/clipboard if not provided)

Examples

Redirect an API request to your local service:

localcurl http://localhost:3000 'curl -H "Authorization: Bearer token123" https://api.example.com/users'

Keep host prefixes in cookies:

localcurl --keep-host-cookie-prefix http://localhost:8080 'curl --cookie "__Host-session=abc123" https://api.example.com/profile'

Ignore TLS verification for local development:

localcurl --no-verify https://localhost:8443 'curl https://api.example.com/secure-endpoint'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

localcurl-0.2.0.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

localcurl-0.2.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file localcurl-0.2.0.tar.gz.

File metadata

  • Download URL: localcurl-0.2.0.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for localcurl-0.2.0.tar.gz
Algorithm Hash digest
SHA256 820d48d59f2088610e1a415b37507cf79fc7581fcd9d21aaab14e03ca0582104
MD5 7c11904c6b97ee42fd0a674846e6f3a0
BLAKE2b-256 fdb3425108e23e831ceb91e5ba9b086b341c351fdc3ffc354c96038a5d80f10f

See more details on using hashes here.

File details

Details for the file localcurl-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: localcurl-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for localcurl-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc9eb3ee9d5884177727c4aa641efdf84f1ff812fc87011944eb206c37df7e70
MD5 a0cf81d31b56474ee69a3c56539f4fec
BLAKE2b-256 7912fb41545ccae62e48a02b0a4ce999212caef21910fea044d1ad66692cddfd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page