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.1.0.tar.gz (19.6 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.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for localcurl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4a4b0833c8b0d6b336cf09669325ee8e3d8af5a7116208d89de46e434a10941f
MD5 3d84db3033f25e4bd11e95184aa1a08e
BLAKE2b-256 5878fee678b3193006e439def33db7568fe9fabf4659a8eb4a12da9fbe10c9ee

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for localcurl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4141ec264823e6213b439d41907820de7f39260eb2450fa7556f027e5863209
MD5 333bdf54f61f11ae62523e4329f0c7ab
BLAKE2b-256 9a07f8ebb1b2643dfe8a2b72d6ab6c4afe2810683018837c0efb2285269a6ad6

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