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

With uv :

uv tool install localcurl

With pip :

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.3.0.tar.gz (24.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.3.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for localcurl-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8147551221f96be63468d90f31fbfd79609022bdb00f3fb8b1d0d584159b822c
MD5 88f5ad541d6a967765c75dffd3ba8e13
BLAKE2b-256 62ddf58f74ac728faa17ce22a85151975aafbc6b5f99c17ebd30977f7131b304

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for localcurl-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7049d903d1908c0d4d905892ac5011b3ddafc14008ffef0c41ca88602e3fe7a2
MD5 87ab1726c95af4d9ddc9b455b7133346
BLAKE2b-256 83cdaa4b79db3f5b706f90957dabb07df453d89d1ff84dc5ec6e3a10622816c5

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