caching-dev-proxy

command module
v0.0.0-...-2bc8f10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2025 License: GPL-2.0 Imports: 1 Imported by: 0

README

caching-dev-proxy

This project allows you to cache any HTTP request sent by one of the tools on your computer. You can think of it as an alternative to Squid, focused on local usage and developer experience

Features

  • Can cache EVERY request (with no respect to cache headers, e.g. Cache-Control: no-cache)
  • TTL (time to live) for cache entries
  • HTTP proxying
  • HTTPS proxying with MITM
  • explicit & transparent proxying
  • Does not connect to upstream at all if no requests need to be done (unlike Squid, which will pre-init TCP connection for speed)
  • Configuration based on request metadata (url, method..)

Installation

go install github.com/iTrooz/caching-dev-proxy@latest

Usage

Classic (explicit proxying)

  1. (Optional) edit config.yaml, and place it at ~.config/caching-dev-proxy/config.yaml (or specify it when running proxy)

  2. Run proxy with

caching-dev-proxy
  1. Run your requests through the proxy with e.g. curl -x 127.0.0.1:8080 https://example.com

TLS decryption

  1. Generate TLS root certificate and key that caching-dev-proxy will use for TLS decryption. For example:
openssl req -x509 -newkey rsa:4096 -keyout ca.key.pem -out ca.crt.pem -days 8250 -nodes -subj "/CN=My CA"
  1. Add this certificate to your system store. On ArchLinux, use trust anchor <path_to_cert.pem>
  2. Edit config and start proxy as shown above

Transparent proxying

Note: HTTP transparent proxying uses the Host header, and HTTPS transparent proxying uses SNI to determine the upstream host to send the request to. Unlike squid, the destination IP is ignored entirely, allowing for simple domain name spoofing, e.g. by editing /etc/hosts to make given hosts pass through the proxy.

Security considerations

This tool was made to be used by a developer on their development machine. It should not be let exposed to untrusted parties, and ESPECIALLY NOT be freely usable on the Internet. See:

Development

Run

just run <args>

Build

just build

Licence

GPL-2.0-only OR GPL-3.0-or-later with proxy being me (iTrooz) What does that mean ?

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
internal
cache
Handles caching of HTTP responses
Handles caching of HTTP responses

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL